先建立一个table的基类:
public abstract class DbBaseTable {
private static final String TAG = "DbBaseTable";
/**
* @return the DB table name
*/
abstract String getName();
/**
* Creates the DB table ...
分类:
移动开发 时间:
2014-07-27 23:54:19
阅读次数:
478
在基类的table中加入upgrade操作:
public abstract class DbBaseTable {
private static final String TAG = "DbBaseTable";
/**
* @return the DB table name
*/
abstract String getName();
/**
* Creates th...
分类:
移动开发 时间:
2014-07-27 23:52:19
阅读次数:
387
public class Test{ public static void main(String[] args){ Person p = new Person(); }}/*4.修饰的变量是一个常量(所有字符都大些 XXX 或者 XXX_XXX),只能赋值一次! fi...
分类:
编程语言 时间:
2014-07-27 23:33:29
阅读次数:
232
public class MyVolumnView extends View { int count_dark = 7; final int MAX_COUNT = 15; Paint paint; Bitmap dark; Bitmap light; final...
分类:
其他好文 时间:
2014-07-27 23:20:29
阅读次数:
261
public class StringObjectDemo { /** * @param args */ public static void main(String[] args) { String hello = "Hello", lo = "lo"; ...
分类:
编程语言 时间:
2014-07-27 23:07:19
阅读次数:
255
public class Elvis { public static final Elvis INSTANCE = new Elvis(); private final int beltSize; private static final int CURRENT_YEAR = ...
分类:
编程语言 时间:
2014-07-27 23:00:59
阅读次数:
244
import org.slf4j.Logger;import org.slf4j.LoggerFactory;public class MyApp { final static Logger logger = LoggerFactory.getLogger("MyApp.class"); ...
分类:
其他好文 时间:
2014-07-27 22:53:29
阅读次数:
264
/*** 栈(Stack) :存放基本类型的变量数据和对象的引用,但对象本身不存放在栈中,而是存放在堆(new 出来的对象)或者常量池中(字符串常量对象存放 在常量池中)。 堆(heap):存放所有new出来的对象。* 静态存储:存放静态成员(static定义的)。 常量池(...
分类:
编程语言 时间:
2014-07-27 22:45:19
阅读次数:
320
JDK并发工具包中,很多异常处理都使用了如下的结构,如AbstractExecutorService,即只有try和finally没有catch。
class X
{
private final ReentrantLock lock = new ReentrantLock();
// ...
public void m()
{
lock.lock(); ...
分类:
编程语言 时间:
2014-07-27 11:55:33
阅读次数:
275
首先你要弄清接口的含义.接口就是提供一种统一的'协议’,而接口中的属性也属于'协议’中的成员.它们是公共的,静态的,最终的常量.相当于全局常量。
在interface里面的变量都是public static final 的。所以你可以这样写:
public static final int i=10;
或则
int i=10;(可以省略掉一部分)
...
分类:
编程语言 时间:
2014-07-27 11:52:54
阅读次数:
229