GoConqr has a new look! Let us know what you think.

Quiz

Untitled

Fausto Trindade 5 questions

Take the quiz

Questions in this quiz (5)

  1. 1package mind;
    public class Remember {
    public static void think() throws Exception { // k1
    try {
    throw new Exception();
    }
    }
    public static void main(String... ideas) throws Exception {
    think();
    }
    }
    1. AThe code compiles and runs without printing anything.
    2. BThe code compiles but a stack trace is printed at runtime.
    3. CThe code does not compile because of line k1.
    4. DThe code does not compile for another reason.
  2. 2Choose the answer that lists the keywords in the order that they would be used together.
    1. Acatch, try, finally
    2. Btry, catch, finally
    3. Cfinally, catch, try
    4. Dtry, finally, catch
  3. 3Which of the following diagrams of java.lang classes shows the inheritance model properly?Image for question 3
    1. AA
    2. BB
    3. CC
    4. DD
  4. 4Which of the following Throwable types is it recommended not to catch in a Java
    application?
    1. AError
    2. BCheckedException
    3. CException
    4. DRuntimeException
  5. 5What is the output of the following application?

    package game;
    public class Baseball {
    public static void main(String... teams) {
    try {
    int score = 1;
    System.out.print(score++);
    } catch (Throwable t) {
    System.out.print(score++);
    } finally {
    System.out.print(score++);
    }
    System.out.print(score++);
    }
    }
    1. A123
    2. B124
    3. C12
    4. DNone of the above

Information

Description
OCA/OCP JAVA 8(PRACTICE EXAM) Quiz on Untitled, created by Fausto Trindade on 27/12/2020.
Language
Português
Views
0
Rating
No ratings yet
Rate this quiz
Rate this quiz

Feedback

What is it about?

What do you think of the new look?

How do you like it?