摘要:
上代码:package com.wjy;public class Test {public static void main(String[] args) {int[] attay = new int[5];for (int i : attay) {System.out.println("it is " + i);}}}运行结果:it is 0it is 0it is 0it is 0it is 0 阅读全文
摘要:
上代码:package com.wjy;public class Test { public static void main(String[] args){ Student s1=new Student(99); }}class Student{public static Student stu=new Student(22);//这里必须要static修饰,否则会出错。public Student(int age){System.out.println("The age is: "+age);}}运行结果:The age is: 22The age is: 99再看一个 阅读全文