1z0 803 dumps : Sep 2021 Edition
Proper study guides for Rebirth Oracle Java SE 7 Programmer I certified begins with Oracle 1z0 803 pdf preparation products which designed to deliver the Precise 1z0 803 pdf questions by making you pass the 1z0 803 pdf test at your first time. Try the free 1z0 803 dumps demo right now.
Q1. Given:
public class Main {
public static void main(String[] args) {
try {
doSomething();
}
catch (SpecialException e) {
System.out.println(e);
}}
static void doSomething() {
int [] ages = new int[4];
ages[4] = 17;
doSomethingElse();
}
static void doSomethingElse() {
throw new SpecialException("Thrown at end of doSomething() method"); }
}
What is the output?
A. SpecialException: Thrown at end of doSomething() method
B. Error in thread "main" java.lang.
ArrayIndexOutOfBoundseror
C. Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 4
at Main.doSomething(Main.java:12)
at Main.main(Main.java:4)
D. SpecialException: Thrown at end of doSomething() method at
Main.doSomethingElse(Main.java:16)
at Main.doSomething(Main.java:13)
at Main.main(Main.java:4)
Answer: C
Q2. Given:
Which line causes a compilation error?
A. line x1
B. line x2
C. line x3
D. line x4
Answer: B
Q3. Which code fragment is illegal?
A. Option A
B. Option B
C. Option C
D. Option D
Answer: D
Q4. Given:
Given the for loop construct:
Which constructor initializes the variable x3?
A. Only the default constructor of class X
B. Only the no-argument constructor of class Y
C. Only the no-argument constructor of class Z
D. Only the default constructor of object class
Answer: C
Q5. Which two statements are true?
C. An interface CANNOT be extended by another interface.
D. An interface can be extended by an abstract class.
E. An abstract class can be extended by a concrete class.
F. An abstract class CANNOT be extended by an abstract class.
Answer: AE
Q6. Given the following code:
What will make this code compile and run?
A. Change line 2 to the following:
Public int price
B. Change line 4 to the following:
int price = new simple ();
C. Change line 4 to the following:
Float price = new simple ();
D. Change line 5 to the following:
Price = 4f;
E. Change line 5 to the following:
price.price = 4;
F. Change line 5 to the following:
Price = (float) 4:
G. Change line 5 to the following:
Price = (Simple) 4;
H. The code compiles and runs properly; no changes are necessary
Answer: E
Q7. Given:
A. Ym
Xm2
B. Ym
Xm1
C. Compilation fails
D. A Class Cast Exception is thrown at runtime
Answer: B
Q8. 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
Q9. 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
Q10. What is the result?
A. Valid
B. Not valid
C. Compilation fails
D. An IllegalArgumentException is thrown at run time
Answer: C