1Z0-803 Exam - Java SE 7 Programmer I

certleader.com

Q1. Given: 

How many objects have been created when the line / / do complex stuff is reached? 

A. Two 

B. Three 

C. Four 

D. Six 

Answer:

Q2. Class StaticField { 

static int i = 7; 

public static void main(String[] args) { 

StaticFied obj = new StaticField(); 

obj.i++; 

StaticField.i++; 

obj.i++; 

System.out.println(StaticField.i + " "+ obj.i); 

What is the result? 

A. 10 10 

B. 8 9 

C. 9 8 

D. 7 10 

Answer:

Q3. Given: 

What is the result? 

A. Option A 

B. Option B 

C. Option C 

D. Option D 

Answer:

Q4. Given the code fragment: 

String h1 = "Bob"; 

String h2 = new String ("Bob"); 

What is the best way to test that the values of h1 and h2 are the same? 

A. if (h1 = = h2) 

B. if (h1.equals(h2)) 

C. if (h1 = = h2) 

D. if (h1.same(h2)) 

Answer:

Q5. Given: 

What is the result? 

A. One 

B. Two 

C. Three 

D. Compilation fails 

Answer:

Q6. What is the result when this program is executed? 

A. Bob's Name: Bob 

B. Bob's Name: Jian 

C. Nothing prints 

D. Bob’s name 

Answer:

Q7. Given: 

What is the result? 

Oracle 1z0-803 : Practice Test 

A. 0 Done 

B. First Exception Done 

C. Second Exception 

D. Done Third Exception 

E. Third Exception 

Answer: