单项选择题

Given:
11.String test = "a1b2c3";
12.String[] tokens = test.split("\\d");
13.for(String s: tokens) System.out.print(s + " ");
What is the result?()

A.a b c
B.1 2 3
C.a1b2c3
D.a1 b2 c3


您可能感兴趣的试卷

你可能感兴趣的试题

1.多项选择题Given that c is a reference to a valid java.io.Console object,which two code fragments read a line of textfrom the console?()

A.String s = c.readLine();
B.char[] c = c.readLine();
C.String s = c.readConsole();
D.char[] c = c.readConsole();
E.String s = c.readLine("%s", "name ");

2.单项选择题

Given:
12.String csv = "Sue,5,true,3";
13.Scanner scanner = new Scanner( csv );
14.scanner.useDelimiter(",");15. int age = scanner.nextInt();
What is the result?()

A.Compilation fails.
B.After line 15, the value of age is 5.
C.After line 15, the value of age is 3.
D.An exception is thrown at runtime.

3.多项选择题Which three statements concerning the use of the java.io.Serializable interface are true?()

A.Objects from classes that use aggregation cannot be serialized.
B.An object serialized on one JVM can be successfully deserialized on a different JVM.
C.The values in fields with the volatile modifier will NOT survive serialization and deserialization.
D.The values in fields with the transient modifier will NOT survive serialization and deserialization.
E.It is legal to serialize an object of a type that has a supertype that does NOT implement java.io.Serializable.

4.多项选择题

Given:

Which two statements are true about the result if the default locale is Locale.US?()

A.The value of b is 2.
B.The value of a is 3.14.
C.The value of b is 2.00.
D.The value of a is 3.141.
E.The value of a is 3.1415.
F.The value of a is 3.1416.

5.单项选择题

Given that the current directory is empty, and that the user has read and write privileges to the currentdirectory, and the following:

Which statement is true?()

A.Compilation fails.
B.Nothing is added to the file system.
C.Only a new file is created on the file system.
D.Only a new directory is created on the file system.
E.Both a new file and a new directory are created on the file system.

6.单项选择题

Given:

Which statement is true?()

A.Compilation fails.
B.An exception is thrown at runtime.
C.Synchronizing the run() method would make the class thread-safe.
D.The data in variable "x" are protected from concurrent access problems.
E.Declaring the doThings() method as static would make the class thread-safe.

7.多项选择题

Given

Which two statements are true?()

A.Foo.beta() is a valid invocation of beta().
B.Foo.alpha() is a valid invocation of alpha().
C.Method beta() can directly call method alpha().
D.Method alpha() can directly call method beta().

8.多项选择题

Given:

And MainClass exists in the /apps/com/company/application directory. 
Assume the CLASSPATH environment variable is set to "." (current directory).
Which two java commands entered at the command line will run MainClass?()

A.java MainClass if run from the /apps directory
B.java com.company.application.MainClass if run from the /apps directory
C.java -classpath /apps com.company.application.MainClass if run from any directory
D.java -classpath . MainClass if run from the /apps/com/company/application directory
E.java -classpath /apps/com/company/application:. MainClass if run from the /apps directory

9.单项选择题

Given:

What is the result?()

A.w-f
B.f-p w-f
C.w-f b-f
D.f-p w-f b-f

10.单项选择题

Click the Exhibit button.

What is the output of the program shown in the exhibit?()

A.300-100-100-100-100
B.300-300-100-100-100
C.300-300-300-100-100
D.300-300-300-300-100

最新试题

Given:A programmer is developing a class Key, that will be used as a key in a standard java.util.HashMap. Which two methods should be overridden to assure that Key works correctly as a key?()

题型:多项选择题

A team of programmers is involved in reviewing a proposed design for a new utility class. After some discussion, they realize that the current design allows other classes to access methods in the utility class that should be accessible only to methods within the utility class itself.What design issue has the team discovered?()

题型:单项选择题

Click the Exhibit button.Which statement is true about the set variable on line 12?()

题型:单项选择题

Given:Which command-line invocations will compile?()

题型:单项选择题

Click the Exhibit button.Which graph represents the correct directory structure for a JAR file from which those classes can be used by the compiler and JVM?()

题型:单项选择题

Given:What is the result?()

题型:单项选择题

Given:What is the result?()

题型:单项选择题

Given:Which two code fragments, inserted independently at line 13, will compile?()

题型:多项选择题

Given:What is the result?()

题型:单项选择题

Given:Which code fragment, inserted at the end of line 12, produces the output p is 420?()

题型:单项选择题