Quiz
2
Create a free account to finish this quiz
Save your progress and see your final score.
Already have an account? Sign in
Questions in this quiz (20)
1None of the wrapper classes own any static methods.
- ATrue
- BFalse
2You can invoke String methods from a String literal.
- ATrue
- BFalse
3Two instances of the Integer wrapper class can be compared for equality, on the basis of their int values, using ==.
- ATrue
- BFalse
4The StringTokenizer .nextToken() method actually removes tokens from the tokenizer object.
- ATrue
- BFalse
5If a method performs an action that could result in an Exception, that action must be contained in a try/catch block.
- ATrue
- BFalse
6The code that might generate an exception that you wish to catch must be written just before the beginning of the try block.
- ATrue
- BFalse
7A try/catch block is used to catch exceptions.
- ATrue
- BFalse
8Exceptions are Objects
- ATrue
- BFalse
9The value contained in a static attribute can be different for every instance of the class that defines that attribute.
- ATrue
- BFalse
10A class definition determines and limits the behaviour of an instance of that class.
- ATrue
- BFalse
11Classes can contain static or non-static methods, but not both.
- ATrue
- BFalse
12A constructor method is only invoked once during the instantiation of an object.
- ATrue
- BFalse
13When writing Java programs, it is good programming practice to close all open files before the program terminates.
- ATrue
- BFalse
14Reading data from a file does not modify the contents of the file.
- ATrue
- BFalse
15Opening a text file for ‘write’ from a Java program with a FIleOutputStream object can throw a FileNotFoundException.
- ATrue
- BFalse
16In a Java program, it is possible to have the same file open for output at one point in the program, and open for input at a different point in the program.
- ATrue
- BFalse
17If a method assigns a new value to an "int" parameter, that value is also assigned to the variable that was passed to the parameter.
- ATrue
- BFalse
18Suppose Fish is a defined class. It is possible to have two variables myFish1 and myFish2 that refer to the same Fish object.
- ATrue
- BFalse
19A comparison of two objects using == will yield true only if the attribute contents of both objects are exactly the same.
- ATrue
- BFalse
20The == equality operator will always return "true" when applied to two Strings if the two Strings appear the same when printed.
- ATrue
- BFalse
Information
- Description
- Quiz on 2, created by Ricky Zhang on 18/04/2018.
- Author
- Ricky Zhang
- Language
- English
- Views
- 13
- Rating
- No ratings yet Rate this quiz