Skip to main content

Posts

Showing posts from April, 2015

Test : Java_19

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. Select Test Type Timed Test UnTimed Test You Get +1 for each correct answer and -0.25 for each incorrect answer Time Left - minutes :seconds Which of these packages contains abstract keyword? java.util java.io java.system java.lang D A subclass of an abstract class can also be abstract if It is instantiated The static class is declared in the parent class It does not define all the abstract methods in the parent class All of the above C What is the name of the class that is the ancestor to every other class in Java? Object Class root java A In Java by default all the classes extend Object class directly or i

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. Select Test Type Timed Test UnTimed Test 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() C 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 A 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

Test : Java_16

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. Select Test Type Timed Test UnTimed Test You Get +1 for each correct answer and -0.25 for each incorrect answer Time Left - minutes :seconds What is the output of this program? class box { int width; int height; int length; int volume; box() { width = 5; height = 5; length = 6; } void volume() { volume = width*height*length; } } class constructor_output { public static void main(String args[]) { box obj = new box(); obj.volume(); System.out.println(obj.volume); } } } 100 150 200 250 B Which of these have highes

Test : Java_17

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. Select Test Type Timed Test UnTimed Test You Get +1 for each correct answer and -0.25 for each incorrect answer Time Left - minutes :seconds What is the output of this program? class exception_handling { public static void main(String args[]) { try { int i, sum; sum = 10; for (i = -1; i < 3 ;++i) sum = (sum / i); } catch(ArithmeticException e) { System.out.print("0"); } System.out.print(sum); } } 0 05 Compilation Error Runtime Error B What is the output of this program? import java.util.*; class vector { public stat

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. Select Test Type Timed Test UnTimed Test 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 D 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

Test : Java_14

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. Select Test Type Timed Test UnTimed Test You Get +1 for each correct answer and -0.25 for each incorrect answer Time Left - minutes :seconds Which of these interface is implemented by Thread class? Runnable Connections Set MapConnections A What is the output of this program? class area { int width; int length; int area; void area(int width, int length) { this.width = width; this.length = length; } } class Output { public static void main(String args[]) { area obj = new area(); obj.area(5 , 6); System.out.println(obj.length + " " + obj.width); } }

Test : Java_13

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. Select Test Type Timed Test UnTimed Test You Get +1 for each correct answer and -0.25 for each incorrect answer Time Left - minutes :seconds 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. C finalize() method is called just prior to garbage collection. it is not called when object goes out of scope. Which of these operators is used to allocate memory for an object? malloc alloc new give C

Test : Java_12

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. Select Test Type Timed Test UnTimed Test You Get +1 for each correct answer and -0.25 for each incorrect answer Time Left - minutes :seconds Which of the following statements are incorrect? public members of class can be accessed by any code in the program. private members of class can only be accessed by other members of the class. protected members of a class can be inherited by a sub class, and become private members of the sub class. private members of class can be inherited by a sub class, and become protected members in sub class. D What is the output of this program? interface calculate { void cal(int item); } class display implements calculate { int x; void cal(

Test : Java 11

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. Select Test Type Timed Test UnTimed Test You Get +1 for each correct answer and -0.25 for each incorrect answer Time Left - minutes :seconds Which keyword is used by method to refer to the object that invoked it? import catch abstract this D The methods wait() and notify() are defined in java.lang.String java.lang.Runnable java.lang.Thread java.lang.Object D Which of these keywords is used to refer to member of base class from a sub class? upper super this None of the mentioned B What is the output of this program? class multithreaded_programing { public static void main(String args[]) {

Test : Java_10

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. Select Test Type Timed Test UnTimed Test You Get +1 for each correct answer and -0.25 for each incorrect answer Time Left - minutes :seconds Which of the following statements are false in the concept of abstract classes: Can b instantiated It may or may not include abstract methods It can be subclassed None of the above A Which of these is static variable defined in Collections? EMPTY_SET EMPTY_LIST EMPTY_MAP All of the mentioned D Which of the following statements are incorrect? private members of class can only be accessed by other members of the class private members of class can be inherited by a sub class, and become protected member

Test : Java_9

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. Select Test Type Timed Test UnTimed Test You Get +1 for each correct answer and -0.25 for each incorrect answer Time Left - minutes :seconds What is the output of this program? class access{ public int x; private int y; void cal(int a, int b){ x = a + 1; y = b; } void print() { system.out.println(" " + y); } } class access_specifier { public static void main(String args[]) { access obj = new access(); obj.cal(2, 3); System.out.println(obj.x); obj.print(); } } 2 3 3 3 Runtime Error Compilation Error B What will be the o

Test : Java_8

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. Select Test Type Timed Test UnTimed Test You Get +1 for each correct answer and -0.25 for each incorrect answer Time Left - minutes :seconds What is the output of this program? class newthread extends Thread { Thread t; newthread() { t1 = new Thread(this,"Thread_1"); t2 = new Thread(this,"Thread_2"); t1.start(); t2.start(); } public void run() { t2.setPriority(Thread.MAX_PRIORITY); System.out.print(t1.equals(t2)); } } class multithreaded_programing { public static void main(String args[]) { new newthread(); } } true false truefalse falsefalse D Which of these classes is not part of Java?s co