<< < 1 2 3 4 5 6 7 8 9 10 > >>   Sort: Date

What will be the default values of all the elements of an array defined as an instance variable?
What will be the default values of all the elements of an array defined as an instance variable? If the array is an array of primitive types, then all the elements of the array will be initialized to the default value corresponding to that primitive type. e.g. All the elements of an array of int wil...
2013-07-03, 3236👍, 0💬

What will be the initial value of an object reference which is defined as an instance variable?
What will be the initial value of an object reference which is defined as an instance variable? The object references are all initialized to null in Java. However in order to do anything useful with these references, you must set them to a valid object, else you will get NullPointerExceptions everyw...
2013-06-28, 3211👍, 0💬

What classes of exceptions may be caught by a catch clause?
What classes of exceptions may be caught by a catch clause? A catch clause can catch any exception that may be assigned to the Throwable type. This includes the Error and Exception types.
2012-07-18, 3139👍, 0💬

Is exit a keyword in Java?
Is exit a keyword in Java? No. To exit a program explicitly you use exit method in System object.
2013-06-27, 3129👍, 0💬

Can main method be declared final?
Can main method be declared final? Yes, the main method can be declared final, in addition to being public static.
2013-07-02, 3063👍, 0💬

What is the difference between preemptive scheduling and time slicing?
What is the difference between preemptive scheduling and time slicing? Under preemptive scheduling, the highest priority task executes until it enters the waiting or dead states or a higher priority task comes into existence. Under time slicing, a task executes for a predefined slice of time and the...
2013-06-20, 3023👍, 0💬

What is the immediate superclass of the Applet class?
What is the immediate superclass of the Applet class? Panel
2012-10-03, 2991👍, 0💬

What is the purpose of the wait(), notify(), and notifyAll() methods?
What is the purpose of the wait(), notify(), and notifyAll() methods? The wait(),notify(), and notifyAll() methods are used to provide an efficient way for threads to communicate each other.
2012-06-14, 2974👍, 0💬

What is the purpose of the enableEvents() method?
What is the purpose of the enableEvents() method? The enableEvents() method is used to enable an event for a particular object. Normally, an event is enabled when a listener is added to an object for a particular event. The enableEvents() method is used by objects that handle events by overriding th...
2012-08-03, 2973👍, 0💬

Which containers use a border layout as their default layout?
Which containers use a border layout as their default layout? The Window, Frame and Dialog classes use a border layout as their default layout.
2012-05-30, 2972👍, 0💬

Are the imports checked for validity at compile time? e.g. will the code containing an import such as java.lang.ABCD compile?
Are the imports checked for validity at compile time? e.g. will the code containing an import such as java.lang.ABCD compile? Yes the imports are checked for the semantic validity at compile time. The code containing above line of import will not compile. It will throw an error saying,can not resolv...
2013-05-13, 2970👍, 0💬

How does Java handle integer overflows and underflows?
How does Java handle integer overflows and underflows? It uses those low order bytes of the result that can fit into the size of the type allowed by the operation.
2013-06-06, 2948👍, 0💬

What does a well-written OO program look like?
What does a well-written OO program look like? A well-written OO program exhibits recurring structures that promote abstraction, flexibility, modularity and elegance.
2012-05-15, 2947👍, 0💬

What if I do not provide the String array as the argument to the method?
What if I do not provide the String array as the argument to the method? Program compiles but throws a runtime error "NoSuchMethodError".
2013-05-03, 2941👍, 0💬

Is delete a keyword in Java?
Is delete a keyword in Java? No, delete is not a keyword in Java. Java does not make use of explicit destructors the way C++ does.
2013-06-26, 2936👍, 0💬

What is an object's lock and which object's have locks?
What is an object's lock and which object's have locks? An object's lock is a mechanism that is used by multiple threads to obtain synchronized access to the object. A thread may execute a synchronized method of an object only after it has acquired the object's lock. All objects and classes have loc...
2012-07-12, 2915👍, 0💬

If I do not provide any arguments on the command line, then the String array of Main method will be empty or null?
If I do not provide any arguments on the command line, then the String array of Main method will be empty or null? It is empty. But not null.
2013-05-06, 2905👍, 0💬

Can you call one constructor from another if a class has multiple constructors?
Can you call one constructor from another if a class has multiple constructors? Yes. Use this() syntax.
2012-09-06, 2901👍, 0💬

What is scalability and performance?
What is scalability and performance? Performance is a measure of "how fast can you perform this task." and scalability describes how an application behaves as its workload and available computing resources increase.
2012-08-16, 2896👍, 0💬

What class is the top of the AWT event hierarchy?
What class is the top of the AWT event hierarchy? The java.awt.AWTEvent class is the highest-level class in the AWT event-class hierarchy.
2012-10-12, 2875👍, 0💬

What is the relationship between synchronized and volatile keyword?
What is the relationship between synchronized and volatile keyword? The JVM is guaranteed to treat reads and writes of data of 32 bits or less as atomic.(Some JVM might treat reads and writes of data of 64 bits or less as atomic in future) For long or double variable, programmers should take care in...
2012-08-28, 2867👍, 0💬

What is the default value of the local variables?
What is the default value of the local variables? The local variables are not initialized to any default value, neither primitives nor object references. If you try to use these variables without initializing them explicitly, the java compiler will not compile the code. It will complain abt the loca...
2013-07-01, 2866👍, 0💬

If a method is declared as protected, where may the method be accessed?
If a method is declared as protected, where may the method be accessed? A protected method may only be accessed by classes or interfaces of the same package or by subclasses of the class in which it is declared.
2012-06-21, 2863👍, 0💬

How are Observer and Observable used?
How are Observer and Observable used? Objects that subclass the Observable class maintain a list of observers. When an Observable object is updated, it invokes the update() method of each of its observers to notify the observers that it has changed state. The Observer interface is implemented by obj...
2012-05-31, 2861👍, 0💬

<< < 1 2 3 4 5 6 7 8 9 10 > >>   Sort: Date