System.out.println("book"); }
public Book(int x) { System.out.println("book"); System.out.println("book" + x);
}
public Book(int x, int y) { System.out.println("book"); System.out.println("book" + x); System.out.println("book" + y); } }
}
参与private
35
类的图形表示
36
构造方法与匿名对象
构造方法必需与类名一样 构造方法没有前往值 可以有多构造方法 每个必需有构造方法 class Person{ } 通俗的说只运用一次的对象称为匿名对象
37
字符串拆分
public class StringDemo {
public static void main(String[] args) { String s = "asd,333,2222,000,1111";
}
24
方法与数组
public class MethodArray { public static void main(String args[]) { int temp[] = { 1, 3, 5, 7, 9 }; // 声明数组 fun(temp); print(temp); }
public static void fun(int[] x) { x[0] = 6; // 修正第一个元素