java Test 2222
java Test 1234
java Test 4242
java Test 4321
第1题:
下列哪个选项的java源文件代码片段是不正确的?
A.package testpackage; public class Test{ }
B.import java. io. *; package testpaekage; public class Test { }
C.import java.io.*; class Person { } public class Test { }
D.import java.io.*; import java. awt.*; public class Test{ }
第2题:
下列哪个选项的java源文件程序段是不正确的? ( )
A.package testpackage; public class Test{ }
B.import java.io.*; package testpackage; public class Test{ }
C.import java.i.*; class Person{} public class Test{ }
D.import java.io.*; import java.awt.*; public class Test { }
第3题:
要运行一个名为Test.class的类文件,需要在DOS提示符下输入( )命令。
A.javac Test
B.javac Test. class
C.java Test
D.java Test. class
第4题:
public class test( public static void main(string[]args){ string foo = args [1]; string foo = args [2]; string foo = args [3]; } ) And command line invocation: Java Test red green blue What is the result?()
第5题:
以下哪些是合法的构造RandomAccessFile对象的代码()。
第6题:
public class Test { public static void main( String[] args) { String foo = args[1]; String bar = args[2]; String baz = args[3]; System.out.println(“baz = “ + baz); } } And the command line invocation: java Test red green blue What is the result?()
第7题:
public class Test{ public static void main( String[] argv ){ // insert statement here } } Which statement, inserted at line 3, produces the following output?() Exception in thread “main” java.lang.AssertionError: true at Test.main(Test.java:3)
第8题:
public class Test { public static void main(String [] args) { System.out.println(args.length > 4 && args[4].equals(“-d”)); } } If the program is invoked using the command line: java Test One Two Three –d What is the result?()
第9题:
true
false
Compilation fails.
An exception is thrown at runtime.
第10题:
baz =
baz = null
baz = blue
Compilation fails.
An exception is thrown at runtime.
第11题:
assert true;
assert false;
assert false : true;
assert false == true;
assert false: false;
第12题:
Baz has the value of “”
Baz has the value of null
Baz has the value of “red”
Baz has the value of “blue”
Bax has the value of “green”
The program throws an exception.
第13题:
下列( )选项的java源文件代码片段是不正确的。
A.package testpackage; publicClass Test{}
B.import java.io.*; package testpackage: publicClass Test{}
C.import java.io.*; Class Person{} publicClass Test{}
D.import java.io.*; import java.awt.*; publicClass Test{}
第14题:
阅读下列代码 public class Test2005{ public static void main(String args[]){ String s="Test"; switch(s){ case"Java":System.out.print("Java"); break; case"Language":System.out.print("Lan- guage"); break; case"Test":System.out.print("Test"); break; } } } 其运行结果是( )。
A.Java
B.Language
C.Test
D.编译时出错
第15题:
AUNIXusernamedBobwantstoreplacehischessprogramwithanewone,butheisnotsurewheretheoldoneisinstalled.BobiscurrentlyabletorunaJavachessprogramstartingfromhishomedirectory/home/bobusingthecommand:java-classpath/test:/home/bob/downloads/*.jargames.ChessBob’sCLASSPATHisset(atlogintime)to:/usr/lib:/home/bob/classes:/opt/java/lib:/opt/java/lib/*.jarWhatisapossiblelocationfortheChess.classfile?()
A./test/Chess.class
B./home/bob/Chess.class
C./test/games/Chess.class
D./usr/lib/games/Chess.class
E./home/bob/games/Chess.class
第16题:
public class test { public static void main(String [] a) { assert a.length == 1; } } Which two will produce an AssertionError?()
第17题:
一个Applet编译后的类名是Test.class,运行此小程序的命令是Java Test。
第18题:
public class Test { public static void main (String[]args) { String foo = args[1]; String bar = args[2]; String baz = args[3]; System.out.printIn(“baz = ” + baz); } } And the output: Baz = 2 Which command line invocation will produce the output?()
第19题:
public class test( public static void main(stringargs){ string foo = args [1]; string foo = args ; string foo = args ; } ) And command line invocation: Java Test red green blue What is the result? ()
第20题:
A UNIX user named Bob wants to replace his chess program with a new one, but he is not sure where theold one is installed. Bob is currently able to run a Java chess program starting from his home directory /home/bob using the command: java -classpath /test:/home/bob/downloads/*.jar games.Chess Bob’s CLASSPATH is set (at login time) to: /usr/lib:/home/bob/classes:/opt/java/lib:/opt/java/lib/*.jar What is a possible location for the Chess.class file?()
第21题:
Baz has the value of “”
Baz has the value of null
Baz has the value of “red”
Baz has the value of “blue”
Bax has the value of “green”
The program throws an exception.
第22题:
Java Test 2222
Java Test 1 2 3 4
Java Test 4 2 4 2
Java Test 4 3 2 1
第23题:
Java Test 2222
Java Test 1 2 3 4
Java Test 4 2 4 2
Java Test 4 3 2 1
第24题:
java Test 2222
java Test 1234
java Test 4242
java Test 4321