Test : Java_18
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 of Thread class is used to find out the priority given to a thread?
| get() | ThreadPriority() |
| getPriority() | getThreadPriority() |
In the following example, which class must be abstract:
abstract class X implements Y {
// implements all but one method of Y
}
class XX extends X {
// implements the remaining method in Y
}| Class x | Class xx |
| Both | None of the above |
What will be the content of array variable table after executing the following code?
for(int i = 0; i < 3; i + +) for(int j = 0; j < 3; j + +) if(j = i) table[i][j] = 1; else table[i][j] = 0;
| 0 0 0 0 0 0 0 0 0 | 1 0 0 1 1 0 1 1 1 |
| 1 0 0 0 1 0 0 0 1 | 0 0 1 0 1 0 1 0 0 |
Which of these interface is not a part of Java?s collection framework?
| List | Set |
| SortedMap | SortedList |
Which of these keywords is used by a class to use an interface defined previously?
| import | Import |
| implememnts | Implememnts |
Which of these method wakes up all the threads?
| wakeAll() | notify() |
| start() | notifyAll() |
What is the output of this program?
class newthread extends Thread {
Thread t;
String name;
newthread(String threadname) {
name = threadname;
t = new Thread(this,name);
t.start();
}
public void run() {
}
}
class multithreaded_programing {
public static void main(String args[]) {
newthread obj1 = new newthread("one");
newthread obj2 = new newthread("two");
try {
System.out.print(obj1.t.equals(obj2.t));
}
catch(Exception e) {
System.out.print("Main thread interrupted");
}
}
}| true | false |
Which of these is a super class of all exceptional type classes?
| String | RuntimeExceptions |
| Throwable | Cachable |
What is the value stored in x in following lines of code?
int x, y, z;
x = 0;
y = 1;
x = y = z = 8;
| 0 | 1 |
| 9 | 8 |
Which of these is correct way of inheriting class A by class B?
| class B + class A {} | class B inherits class A {} |
| class B extends A {} | class B extends class A {} |
Finish Test
No comments: