¡GoConqr estrena diseño! Cuéntanos qué te parece.

Test

OCAJP7 part 2

. 6 preguntas

Hacer el test

Preguntas del test (6)

  1. 1Select the one most appropriate answer. What is the purpose of method parseInt defined in Integer class.
    1. AThe method converts an integer to a String.
    2. BThe method is used to convert String to an integer, assuming that the String represents an integer.
    3. CThe method is used to convert String to Integer class, assuming that the String represents an integer.
    4. DThe method converts the Integer object to a String.
  2. 2What should be done to invoke the run() method on a thread for an object derived from the Thread class. Select the one correct answer.
    1. AThe run() method should be directly invoked on the Object.
    2. BThe start() method should be directly invoked on the Object.
    3. CThe init() method should be directly invoked on the Object.
    4. DThe creation of the object using the new operator would create a new thread and invoke its run() method.
  3. 3Which of the following statements are correct. Select the four correct answers.
    1. AA Java program must have a package statement.
    2. BA package statement if present must be the first statement of the program (barring any comments).
    3. CIf a Java program defines both a package and import statement, then the import statement must come before the package statement.
    4. DAn empty file is a valid source file.
    5. EA Java file without any class or interface definitions can also be compiled.
    6. FIf an import statement is present, it must appear before any class or interface definitions.
  4. 4What would be the results of compiling and running the following class. Select the one correct answer.
    class test
    {
    public static void main()
    {
    System.out.println("test");
    }
    }
    1. AThe program compiles and runs but does not generate any output.
    2. BThe program compiles and runs generating an output of "test"
    3. CThe program compiles but does not run.
    4. DThe program does not compile as there is no main method defined
  5. 5Which of the following statements are true. Select the one correct answer.
    1. AArrays in Java are essentially objects.
    2. BIt is not possible to assign one array to another. Individual elements of array can however be assigned
    3. CArray elements are indexed from 1 to size of array.
    4. DIf a method tries to access an array element beyond its range, a compile warning is generated.
  6. 6The class java.lang.Exception is ?
    1. Aprotected
    2. Bimplements Throwable
    3. Cimplements Serializable
    4. Dextends Throwable

Información

Descripción
Second part of previous quiz.
Autor
. .
Idioma
English
Visitas
64
Etiquetas
javaocajp7
Valoración
Aún sin valoraciones
Valora este test
Valora este test

Escríbenos

¿Sobre qué es tu mensaje?

¿Qué te parece el nuevo diseño?

¿Te gusta?