Question: QUESTION 1 A static variable of a class cannot be changed. True False 2 points QUESTION 2 A .java file may have any number of
QUESTION 1
A static variable of a class cannot be changed.
True
False
2 points
QUESTION 2
A .java file may have any number of public classes.
True
False
2 points
QUESTION 3
The following statement correctly creates a Scanner object for user input from the keyboard.
Scanner kb = new Scanner(System.keyboard);
True
False
2 points
QUESTION 4
A class is an instance of an object.
True
False
2 points
QUESTION 5
A class can have any number of constructors.
True
False
2 points
QUESTION 6
The functions or data members declared private in a class can only be accessed only through definition those functions declared in that class.
True
False
2 points
QUESTION 7
You can write a class that is useful with all its methods and variables declared private.
True
False
2 points
QUESTION 8
A class member that is to be shared among all objects of a class is called
| A final member | ||
| A reference member | ||
| A static member | ||
| A value member |
3 points
QUESTION 9
What will be the output of the following code fragment?
{
System.out.println("result = " + 1 + 4);
}
| result = 5 | ||
| result = 14 | ||
| result = 0 | ||
| result = null |
3 points
QUESTION 10
When saving a Java source file, save it with the extension of
| .java | ||
| .javac | ||
| .class | ||
| .src |
3 points
QUESTION 11
A file with the .class extension means that the file:
| Contains Java source code. | ||
| Contains HTML. | ||
| was produced by the Java compiler. | ||
| was produced by the Java interpreter. |
3 points
QUESTION 12
Which of the following are correct?
| A constructor must be declared with a return type | ||
| A constructor must be declared for each class. | ||
| A class can have only one default constructor. | ||
| A default constructor can only be provided by the java compiler. |
3 points
QUESTION 13
Which keyword do we use to specify a constant variable ? (one the does not change after the initial assignment)
| const | ||
| constant | ||
| final | ||
| fixed |
3 points
QUESTION 14
Which Java package includes the Scanner class?
| awt | ||
| swing | ||
| util | ||
| lang |
3 points
QUESTION 15
Which of the following statements is used to terminate the current interation of the loop, and go on the next interation of the loop?
| break; | ||
| continue; | ||
| switch | ||
| if .... else .... ; |
3 points
QUESTION 16
What does the following Boolean expression evaluate to?
(!(5 < 3))
| unknown | ||
| true | ||
| false | ||
| null |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
