Test
Sin título
Preguntas del test (5)
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();
}
}- AThe code compiles and runs without printing anything.
- BThe code compiles but a stack trace is printed at runtime.
- CThe code does not compile because of line k1.
- DThe code does not compile for another reason.
2Choose the answer that lists the keywords in the order that they would be used together.
- Acatch, try, finally
- Btry, catch, finally
- Cfinally, catch, try
- Dtry, finally, catch
3Which of the following diagrams of java.lang classes shows the inheritance model properly?
- AA
- BB
- CC
- DD
4Which of the following Throwable types is it recommended not to catch in a Java
application?- AError
- BCheckedException
- CException
- DRuntimeException
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++);
}
}- A123
- B124
- C12
- DNone of the above
Información
- Descripción
- OCA/OCP JAVA 8(PRACTICE EXAM) Test sobre Sin título, creado por Fausto Trindade el 27/12/2020.
- Autor
- Fausto Trindade
- Idioma
- Português
- Visitas
- 0
- Etiquetas
- Valoración
- Aún sin valoraciones Valora este test