Test : Java_15
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 method is used to avoid polling in Java?
| wait() | notify() |
| notifyAll() | All of the mentioned |
What is the output of this program?
class exception_handling {
public static void main(String args[]) {
try {
int a, b;
b = 0;
a = 5 / b;
System.out.print("A");
}
catch(ArithmeticException e) {
System.out.print("B");
}
}
}| A | B |
| Compilation Error | Runtime Error |
Which of these access specifier must be used for class so that it can be inherited by another sub class?
| public | private |
| both a & b | None of the mentioned |
what will be the output
int i=10;
System.out.println(i++);
| 9 | 10 |
| 11 | 12 |
What is the output of this program?
class Output {
public static void main(String args[])
{
boolean a = true;
boolean b = false;
boolean c = a ^ b;
System.out.println(!b);
}
}| true | false |
| 0 | 1 |
What is the priority of the thread in output of this program?
class multithreaded_programing {
public static void main(String args[]) {
Thread t = Thread.currentThread();
t.setName("New Thread");
System.out.println(t.getName());
}
}| main | Thread |
| New Thread | Thread[New Thread,5,main] |
Which of the folowing stements are incorrect?
| Default constructor is called at the time of declaration of the object if a constructor has not been defined. | Constructor can be parameterized. |
| finalize() method is called when a object goes out of scope and is no longer needed. | finalize() method must be declared protected. |
Which of these class is used to make a thread?
| String | System |
| Thread | Runnable |
Which of these interface is not a part of Java?s collection framework?
| List | Set |
| SortedMap | SortedList |
What is the value returned by unction compareTo() if the invoking string is less than the string compared?
| zero | value less than zero |
| value greater than zero | None of the mentioned |
Finish Test
No comments: