Quiz
OCAJP7 part 2
Erstelle ein kostenloses Konto, um dieses Quiz zu beenden
Speichere deinen Fortschritt und sieh dir dein Endergebnis an.
oder mit deiner E-Mail registrieren
Schon ein Konto? Anmelden
Fragen in diesem Quiz (6)
1Select the one most appropriate answer. What is the purpose of method parseInt defined in Integer class.
- AThe method converts an integer to a String.
- BThe method is used to convert String to an integer, assuming that the String represents an integer.
- CThe method is used to convert String to Integer class, assuming that the String represents an integer.
- DThe method converts the Integer object to a String.
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.
- AThe run() method should be directly invoked on the Object.
- BThe start() method should be directly invoked on the Object.
- CThe init() method should be directly invoked on the Object.
- DThe creation of the object using the new operator would create a new thread and invoke its run() method.
3Which of the following statements are correct. Select the four correct answers.
- AA Java program must have a package statement.
- BA package statement if present must be the first statement of the program (barring any comments).
- CIf a Java program defines both a package and import statement, then the import statement must come before the package statement.
- DAn empty file is a valid source file.
- EA Java file without any class or interface definitions can also be compiled.
- FIf an import statement is present, it must appear before any class or interface definitions.
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");
}
}- AThe program compiles and runs but does not generate any output.
- BThe program compiles and runs generating an output of "test"
- CThe program compiles but does not run.
- DThe program does not compile as there is no main method defined
5Which of the following statements are true. Select the one correct answer.
- AArrays in Java are essentially objects.
- BIt is not possible to assign one array to another. Individual elements of array can however be assigned
- CArray elements are indexed from 1 to size of array.
- DIf a method tries to access an array element beyond its range, a compile warning is generated.
6The class java.lang.Exception is ?
- Aprotected
- Bimplements Throwable
- Cimplements Serializable
- Dextends Throwable
Informationen
- Beschreibung
- Second part of previous quiz.
- Autor
- . .
- Sprache
- English
- Aufrufe
- 64
- Schlagwörter
- Bewertung
- Noch keine Bewertungen Bewerte dieses Quiz