常量的用法

class Tom{
final int MAX=100;
static final int MIN=20;
}
public class Example4_5{
public static void main(String args[]){
System.out.println(Tom.MIN);
Tom cat=new Tom();
int x=0;
x=Tom.MIN+cat.MAX;
System.out.println(x);
}
}

posted on 2013-03-24 16:37  agony·  阅读(163)  评论(0编辑  收藏  举报

导航