Proper study guides for Update Oracle Java SE 7 Programmer I certified begins with Oracle java se 7 programmer i 1z0 803 preparation products which designed to deliver the Actual 1z0 803 practice test questions by making you pass the java se 7 programmer i 1z0 803 test at your first time. Try the free 1z0 803 practice test demo right now.
Q1. Which two statements are true for a two-dimensional array of primitive data type?
A. It cannot contain elements of different types.
B. The length of each dimension must be the same.
C. At the declaration time, the number of elements of the array in each dimension must be
specified.
D. All methods of the class object may be invoked on the two-dimensional array.
Answer: CD
Q2. Given:
A. X XX
B. X Y X
C. Y Y X
D. Y YY
Answer: D
Q3. ArrayList<Integer> list = new ArrayList<>(1);
2. list.add(1001);
3. list.add(1002);
4. System.out.println(list.get(list.size()));
What is the result?
A. Compilation fails due to an error on line 1.
B. An exception is thrown at run time due to error on line 3
C. An exception is thrown at run time due to error on line 4
D. 1002
Answer: C
Q4. Which three are bad practices?
A. Checking for ArrayIndexoutofBoundsException when iterating through an array to determine when all elements have been visited
B. Checking for Error and. If necessary, restarting the program to ensure that users are unaware problems
C. Checking for FileNotFoundException to inform a user that a filename entered is not valid
D. Checking for ArrayIndexoutofBoundsException and ensuring that the program can recover if one occur
E. Checking for an IOException and ensuring that the program can recover if one occurs
Answer: ABD
Q5. Which statement initializes a stringBuilder to a capacity of 128?
A. StringBuilder sb = new String ("128");
B. StringBuilder sb = StringBuilder.setCapacity (128);
C. StringBuilder sb = StringBuilder.getInstance (128);
D. StringBuilder sb = new StringBuilder (128);
Answer: D
Q6. Which two are valid instantiations and initializations of a multi dimensional array?
A. Option A
B. Option B
C. Option C
D. Option D
E. Option E
Answer: BD
Q7. Given:
What is the result?
A. 6 5 6 4
B. 6 5 5 4
C. 6 5 6 6
D. 6 5 6 5
Answer: A
Q8. A method is declared to take three arguments. A program calls this method and passes only two arguments. What is the results?
A. Compilation fails.
B. The third argument is given the value null.
C. The third argument is given the value void.
D. The third argument is given the value zero.
E. The third argument is given the appropriate falsy value for its declared type.
F. An exception occurs when the method attempts to access the third argument.
Answer: A
Q9. class Overloading {
int x(double d) {
System.out.println("one");
return 0;
}
String x(double d) {
System.out.println("two");
return null;
}
double x(double d) {
System.out.println("three");
return 0.0;
}
public static void main(String[] args) {
new Overloading().x(4.0);
}
}
What is the result?
A. One
B. Two
C. Three
D. Compilation fails.
Answer: D
Q10. Given the code fragment:
A. 20
B. 25
C. 29
D. Compilation fails
E. An Array Index Out Of Bounds Exception is thrown at runtime
Answer: B
Q11. Which two statements are true for a two-dimensional array?
A. It is implemented as an array of the specified element type.
B. Using a row by column convention, each row of a two-dimensional array must be of the same size.
C. At declaration time, the number of elements of the array in each dimension must be specified.
D. All methods of the class Object may be invoked on the two-dimensional array.
Answer: AD
Q12. Given:
And the commands:
Javac Test.java
Java Test 12345
What is the result?
A. Number us : 12345
B. A NullPointerException is thrown at runtime
C. A NumberFormatException is thrown at runtime
D. AnArrayIndexOutOfBoundException is thrown at runtime.
Answer: A
Q13. Give:
What value should replace kk in line x to cause jj = 5 to be output?
A. -1
B. 1
C. 5
D. 8
E. 11
Answer: E
Q14. What is the result?
A. sc: class.Object asc: class.AnotherSampleClass
B. sc: class.SampleClass asc: class.AnotherSampleClass
C. sc: class.AnotherSampleClass asc: class.SampleClass
D. sc: class.AnotherSampleClass asc: class.AnotherSampleClass
Answer: D
Q15. Given:
Which three lines will compile and output “right on!”?
A. Line 5
B. Line 6
C. Line 7
D. Line 8
E. Line 9
F. Line 10
Answer: CDF
Q16. Given:
What is the result?
A. Option A
B. Option B
C. Option C
D. Option D
Answer: C