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

Quiz

Java Test

Miguel Lechuga 5 questions

Take the quiz

This quiz has a time limit, so it opens in the usual player.

Questions in this quiz (5)

  1. 1María quiere utilizar un HashSet para almacenar los objetos que construye a partir de una consulta a la base de datos.

    ¿Qué métodos necesita sobreescribir en los objetos para que el HasSet se comporte apropiadamente?
    1. Aint hashCode()
    2. BString toString()
    3. Cboolean equals(Object o)
    4. Dpublic int compareTo(Object o)
  2. 2Una clase puede implementar múltiles interfaces a la vez si, y sólo si, cumple con el contrato correspondiente a cada una de ellas.
    1. ATrue
    2. BFalse
  3. 3¿Cuál de los siguientes modificadores de acceso no se declara de manera explícita en los miembros de una clase?
    1. AProtected
    2. BDefault
    3. CPublic
    4. DPrivate
  4. 4Tomando en cuenta el siguiente código:

    class Top {
    public Top(String s) { System.out.print("B"); }
    }

    public class Bottom extends Top {
    public Bottom(String s) { System.out.print("D"); }
    public static void main(String[] args) {
    new Bottom("C");
    System.out.println(" ");
    }
    }
    1. ABD
    2. BDBC
    3. CBDC
    4. DNo compila
  5. 5Lea el siguiente código

    try { int x = Integer.parseInt("two") }

    ¿Qué excepción sería apropiada colocar en el catch?
    1. ANumberFormatException
    2. BIllegalStateException
    3. CClassCastException
    4. DArrayIndexOutofBoundsException

Information

Description
Quiz on Java Test, created by Miguel Lechuga on 13/10/2016.
Language
Español
Views
3
Tags
javaceo/director general
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?