Java MCQ's on Random Java
This test contains 10 questions based on Java.
Each question answered correctly awards you 1 point and each incorrect answer has a penalty of -0.25 points, no points are deducted for unattempted answers.
Each question answered correctly awards you 1 point and each incorrect answer has a penalty of -0.25 points, no points are deducted for unattempted answers.
Select Test Type
You Get +1 for each correct answer and -0.25 for each incorrect answer
Time Left -
minutes
:
seconds
Which of these is not supported by Java ?
Multilevel Inheritence | Multiple Inheritence |
Garbage Collection | Data Hiding |
Which of the following exceptions needs not to be in a try catch block.
ClassNotFound Exception | Arithmatic Exception |
FileNotFound Exception | NoClassDefFound Exception |
Which of the follwoing is the command to compile a java program ?
javacompile | compile |
javac | java c |
Which of the folowing is a class level variable.
public int a; | public static int a; |
public final int a; | public volatile int a; |
Which of the following method is used to start the execution of a thread.
run() | begin() |
start() | execute() |
Which of the following always returns the objects in a sorted manner.
HashMap | HashTable |
TreeSet | HashSet |
What is the return type of hashCode() method of the object class ?
hash | int |
Object | String |
What will be the output of 8 >> 2
8 | 4 |
2 | 1 |
What happens if we call the finalize method on an object.
The object gets ready to be garbage collected. | The object is forced to be garbage collected. |
It has nothing to do with garbage collection. | It does not allow the object to be garbage collected. |
What will be the output of the following program ?
class Test{ public static void main(String args[]){ static int a = 20; System.out.println(a++); } }
20 | 21 |
Compilation Error | None of these |
Finish Test
No comments: