Exam: 310-035 Title : Sun Certified Programmer for Java 2 Platform 1
4 Ver : 04
04 Note: Section A contains 147 questions
Section B contains 147 questions
The total number of questions is 294
Section A QUESTION 1 Given: 1 public class Test { 2 public static void main(String args[]) { 3 class Foo { 4 public int i = 3; 5 } 6 Object o = (Object)new Foo(); 7 Foo foo = (Foo)o; 8 System
println("i = " + foo
i); 9 } 10 } What is the result
i = 3 B
Compilation fails
A ClassCastException is thrown at line 6
A ClassCastException is thrown at line 7
Answer: A QUESTION 2 Which two cause a compiler error
(Choose two) A
float[] = new float(3); B
float f2[] = new float[]; C
float[] f1 = new float[3]; D
float f3[] = new float[3]; E
float f5[] = { 1
0f }; F