System.load(”prop.custom”);
System.getenv(”prop.custom”);
System.property(”prop.custom”);
System.getProperty(”prop.custom”);
System.getProperties().getProperty(”prop.custom”);
第1题:
Value = 3
Value = 4
Value = 5
Value = 6
Value = 7
Value = 8
第2题:
Compilation fails.
An exception is thrown at runtime.
The code executes normally and prints “bar”.
The code executes normally, but nothing prints.
第3题:
put Poker.jar in directory /stuff/java, and set the CLASSPATH to include /stuff/java
put Poker.jar in directory /stuff/java, and set the CLASSPATH to include /stuff/java/*.jar
Put Poker.jar in directory /stuff/java, and set the CLASSPATH to include /stuff/java/Poker.jar
put Poker.jar in directory /stuff/java/games/cards, and set the CLASSPATH to include /stuff/java
put Poker.jar in directory /stuff/java/games/cards, and set the CLASSPATH to include /stuffijava/*.jar
put Poker.jar in directory /stuff/java/games/cards, and set the CLASSPATH to include /stuff/java/Poker.jar
第4题:
what classes are instantiated from.
an instance of a class.
a blueprint for creating concrete realization of abstractions.
a reference to an attribute.
a variable.
第5题:
An error at line 11 causes compilation to fail.
Errors at lines 7 and 8 cause compilation to fail.
The program prints pairs of values for x and y that might not always be the same on the same line (for example, “x=2, y=1”)
The program prints pairs of values for x and y that are always the same on the same line (forexample, “x=1, y=1”. In addition, each value appears twice (for example, “x=1, y=1” followed by “x=1, y=1”)
The program prints pairs of values for x and y that are always the same on the same line (for example, “x=1, y=1”. In addition, each value appears twice (for example, “x=1, y=1” followed by “x=2s, y=2”)
第6题:
static class InnerOne { public double methoda() { return d1; } }
static class InnerOne { static double methoda() { return d1; } }
private class InnerOne { public double methoda() { return d1; } }
protected class InnerOne { static double methoda() { return d1; } }
public abstract class InnerOne { public abstract double methoda(); }
第7题:
5,6
5,5
6,5
6,6
第8题:
4:4:2:2
4:4:3:2
2:2:1:0
2:2:0:0
2:1:0:0
2:2:1:1
4:3:2:1
第9题:
Calling the yield method.
Calling the wait method on an object.
Calling the notify method on an object.
Calling the notifyAll method on an object.
Calling the start method on another Thread object.
第10题:
If only one thread is blocked in the wait method of an object, and another thread executes the modify on that same object, then the first thread immediately resumes execution.
If a thread is blocked in the wait method of an object, and another thread executes the notify method on the same object, it is still possible that the first thread might never resume execution.
If a thread is blocked in the wait method of an object, and another thread executes the notify method on the same object, then the first thread definitely resumes execution as a direct and sole consequence of the notify call.
If two threads are blocked in the wait method of one object, and another thread executes the notify method on the same object, then the first thread that executed the wait call first definitely resumes execution as a direct and sole consequence of the notify call.
第11题:
String s = c.readLine();
char[ ] c = c.readLine();
String s = c.readConsole();
char[ ] c = c.readConsole();
String s = c.readLine(%s, name );
char[ ] c = c.readLine(%s, name );
第12题:
Compilation fails.
Pi is approximately 3.
Pi is approximately 3.141593.
An exception is thrown at runtime.
第13题:
The rectangle drawn will have a total width of 5 pixels.
The rectangle drawn will have a total height of 6 pixels.
The rectangle drawn will have a total width of 10 pixels.
The rectangle drawn will have a total height of 11 pixels.
第14题:
The charAt() method of the String class.
The toUpperCase() method of the String class.
The replace() method of the String class.
The reverse() method of the StringBuffer class.
The length() method of the StringBuffer class.
第15题:
Errors at lines 7 and 8 cause compilation to fail.
The program prints pairs of values for x and y that might not always be the same on the same line (for example, “x=2, y=1”).
The program prints pairs of values for x and y that are always the same on the same line (for example, “x=1, y=1”. In addition, each value appears twice (for example, “x=1, y=1” followed by “x=1, y=1”).
The program prints pairs of values for x and y that are always the same on the same line (for example, “x=1, y=1”. In addition, each value appears only for once (for example, “x=1, y=1” followed by “x=2, y=2”).
第16题:
12
18
8
9
27
第17题:
The program runs and prints nothing.
The program runs and prints “Equal”
An error at line 5 causes compilation to fail.
The program runs but aborts with an exception.
第18题:
public int compareTo(Object o) {/*mode code here*/}
public int compareTo(Score other) {/*more code here*/}
public int compare(Score s1,Score s2){/*more code here*/}
public int compare(Object o1,Object o2){/*more code here*/}
第19题:
Private void setVar (int a, float c, int b) {}
Protected void setVar (int a, int b, float c) {}
Public int setVar (int a, float c, int b) (return a;)
Public int setVar (int a, int b, float c) (return a;)
Protected float setVar (int a, int b, float c) (return c;)
第20题:
static class InnerOne { public double methoda() {return d1;} }
static class InnerOne { static double methoda() {return d1;} }
private class InnerOne { public double methoda() {return d1;} }
protected class InnerOne { static double methoda() {return d1;} }
public abstract class InnerOne { public abstract double methoda(); }
第21题:
The default constructor initializes method variables.
The compiler always creates a default constructor for every class.
The default constructor invokes the no-parameter constructor of the superclass.
The default constructor initializes the instance variables declared in the class.
When a class has only constructors with parameters, the compiler does not create a default constructor.
第22题:
Int foo = (int) Math.max(bar);
Int foo = (int) Math.min(bar);
Int foo = (int) Math.abs(bar);
Int foo = (int) Math.ceil(bar);
Int foo = (int) Math.floor(bar);
Int foo = (int) Math.round(bar);
第23题:
The code will not compile.
A Window will appear containing only a Button.
An IllegalArgumentException is thrown at line 6.
A Window button will appear but will not contain the Label, TextField, or Button.
A Window will appear containing a Label at the top, a TextField below the Label, and a Button below the TextField.
A Window will appear containing a Label on the left, a TextField to the right of the Label, and a button to the right of the TextField.
第24题:
An exception is thrown.
The program exists without printing anything.
An error at line 1 causes compilation to fail.
An error at line 2 causes the compilation to fail.
“Running” is printed and the program exits.