《Java 编程思想》第四版 课后练习答案
Java编程思想(第四版)习题答案第二章
练习1:public class PrimitiveTest {
static int i;static char c;
public static void main(String[] args) {
System.out.println("int = " + i); System.out.println("char = " + c);
}
}
练习2:public class HelloWorld {public static void main(String[] args) {
System.out.println("Hello World!");
}
}
练习3:public class ATNTest {
public static void main(String[] args) { class ATypeName { int i; double d; boolean b; void show() { System.out.println(i); System.out.println(d); System.out.println(b);
} }
ATypeName a = new ATypeName(); a.i = 3; a.d = 2.71828; a.b = false;
a.show();
}
}
**** Hidden Message *****
页:
[1]