java基础学习
cg9112
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
构造函数
class person{ int age; String name; String country; { country="中国"; } person(int age){ this.age=age; this.name="佚名"; } person(int age,String name){ this.age=age; this.name=name; }原创 2013-08-20 22:16:56 · 452 阅读 · 0 评论 -
静态成员
class person{ static String name="李四"; static String country="中国"; static{ //静态代码块只会执行一次,当类第一次被调用时 System.out.println("静态代码块!"); } static void say(){ System.out.println("这是一个静态方法!"+name)原创 2013-08-20 22:17:51 · 554 阅读 · 0 评论 -
数组定义,获取最大值和最小值
/*数组的定义方式数组的最大值/最小值获取*/class arr1{ public static void main(String[] args) { /* 格式一:不知具体的数据 */ //int[] arr1=new int[3]; //格式二,已知具体的数据 int[] arr=new int[]{11,23,5,36,44,2}; //i原创 2013-08-13 21:36:02 · 900 阅读 · 0 评论
分享