Quiz of
Java Programming and Related Topics (20 Minutes)
Knowledge and Analysis Section: 12 Sample Multiple Choice Questions (12 points max.)
There is only one correct answer to each question. One point is awarded for each correct answer; zero points for
each incorrect answer; and 0.25 points for each unanswered question. 7.5 points (out of a possible 12) are required
to pass this section.
J23. What does the following code print?
Boolean b1 = new Boolean( true ), b2 = new Boolean( true );
System.out.println( ( b1 == b1 ) + " " + ( b1 == b2 ) );
A) false false
B) true false
C) false true
D) true true
J27. Consider this short program:
class Args {
public static void main(
String [] args ){
System.out.println( args[0] );
}
}
What does the program print when you run it with the following parameters?
java Args #1 #2
A) java
B) Args
C) #1
D) #2
J32. Consider the following class definition:
public class ConstructorTest extends Base {
public ConstructorTest( int i ) { }
}
Which of the following forms of constructor must exist explicitly in the definition of the Base class?
A) Base() { }
B) Base( int i ) { }
C) Base( int i, int j ) { }
D) Base( int i, int j, int k ) { }
J43. What can you NOT do with a JAR file?
A) Digitally sign its entries
B) Compress its entries
C) Include resources other than class files
D) Download only some of its entries
Quiz question: Which tool is most useful for optimizing the speed of your code?
A) Source-level debugger
B) Profiler
C) Disassembler
D) Source code to bytecode optimizing compiler
[ June 10, 2002: Message edited by: Vladimir Kositsky ]
[ June 10, 2002: Message edited by: Vladimir Kositsky ]