Oracle 1Z0-808 Exam (page: 1)
Oracle Java SE 8 Programmer I
Updated on: 25-Aug-2025

Viewing Page 1 of 49

Given the code fragment:


What is the result?

  1. 10 : 10
  2. 5 : 5
  3. 5 : 10
  4. Compilation fails

Answer(s): A



Given:




What is the result?

  1. box
  2. nbo
  3. bo
  4. nb
  5. An exception is thrown at runtime

Answer(s): E



Which three are advantages of the Java exception mechanism?

  1. Improves the program structure because the error handling code is separated from the normal program function
  2. Provides a set of standard exceptions that covers all the possible errors
  3. Improves the program structure because the programmer can choose where to handle exceptions
  4. Improves the program structure because exceptions must be handled in the method in which they occurred
  5. Allows the creation of new exceptions that are tailored to the particular program being created

Answer(s): A,C,E



Given the code fragment:



What is the result?

  1. Jesse 25
    Walter 52
  2. Compilation fails only at line n1
  3. Compilation fails only at line n2
  4. Compilation fails at both line n1 and line n2

Answer(s): D



Given:
class Mid {
public int findMid(int n1, int n2) {
return (n1 + n2) / 2;
}

}
public class Calc extends Mid {
public static void main(String[] args) {
int n1 = 22, n2 = 2;
// insert code here
System.out.print(n3);
}
}
Which two code fragments, when inserted at // insert code here, enable the code to compile and print 12?

  1. Calc c = new Calc();
    int n3 = c.findMid(n1, n2);
  2. int n3 = super.findMid(n1, n3);
  3. Calc c = new Mid();
    int n3 = c.findMid(n1, n2);
  4. Mid m1 = new Calc();
    int n3 = m1.findMid(n1, n2);
  5. int n3 = Calc.findMid(n1, n2);

Answer(s): A,D

Explanation:

Incorrect:
Not B: circular definition of n3.
Not C: Compilation error. line Calc c = new Mid(); required: Calc
found: Mid
Not E: Compilation error. line int n3 = Calc.findMid(n1, n2); non-static method findMid(int, int) cannot be referenced from a static context



Viewing Page 1 of 49



Share your comments for Oracle 1Z0-808 exam with other users:

Mchal 7/20/2023 3:38:00 AM

some questions are wrongly answered but its good nonetheless
POLAND


Merry 7/30/2023 6:57:00 AM

good questions
Anonymous