单项选择题
A.Student stu = new Student(“Tom”,23); stu.study(“数学”);
B.Student.study(“数学”);
C.Student stu = new Student(“Tom”,23); stu.study();
D.Student stu = new Student(“Tom”,23); String result=stu.study(“数学”);
单项选择题 import java.io.PrintWriter; class DoFormat { public static void main(String [] args) { int x = 42; int y = 12345; float z = 7; System.out.format("-%4d- ", x); System.out.format("-%4d- ", y); System.out.format("-%4.1d- ", z); } } 结果为:()
单项选择题 class ThreadBoth extends Thread implements Runnable { public void run(){ System.out.print("hi "); } public static void main(String [] args){ Thread t1 = new ThreadBoth(); Thread t2 = new Thread(t1); t1.run(); t2.run(); } } 结果为:()
单项选择题 假设在目录myprj/src/school中有Java源文件Student.java,如果希望该文件编译后的类文件出现在目录myprj/classes/school中,应该使用下列哪一个命令?()