최신Oracle Java SE 7 Programmer I - 1Z1-803무료샘플문제
Which statement is true about the default constructor of a top-level class?
Given the code fragment:

What is the result?
Given:

How many times is 2 printed as a part of the output?
public class StringReplace {
public static void main(String[] args) {
String message = "Hi everyone!";
System.out.println("message = " + message.replace("e", "X")); }
}
What is the result?
public class Two {
public static void main(String[] args) {
try {
doStuff();
system.out.println("1");
}
catch {
system.out.println("2");
}}
public static void do Stuff() {
if (Math.random() > 0.5) throw new RunTimeException(); doMoreStuff();
System.out.println("3 ");
}
public static void doMoreStuff() {
System.out.println("4");
}
}
Which two are possible outputs?
Given:

Why will the code not compile?
Given:

What is the result?
Which code fragment cause a compilation error?
int i, j=0; i = (3* 2 +4 +5 ) ; j = (3 * ((2+4) + 5)); System.out.println("i:"+ i + "\nj":+j);
What is the result?

public class ForTest {
public static void main(String[] args) { int[] arrar = {1,2,3}; for ( foo ) { } } }
Which three are valid replacements for foo so that the program will compiled and run?
Given:
package p1;
public class Test {
static double dvalue;
static Test ref;
public static void main(String[] args) {
System.out.println(ref);
System.out.println(dvalue);
}
}
What is the result?