Java26 07/10/2008
 

What is a cloneable interface and how many methods does it contain?

It is not having any method because it is a TAGGED or MARKER interface.

What is the difference between Integer and int?

a) Integer is a class defined in the java.lang package, whereas int is a primitive data type defined in the Java language itself. Java does not automatically convert from one to the other.
b) Integer can be used as an argument for a method that requires an object, whereas int can be used for calculations.

How many times may an object’s finalize() method be invoked by the garbage collector?

An object’s finalize() method may only be invoked once by the garbage collector.

What modifiers may be used with top-level class?

public, abstract and final can be used for top-level class.

What is the difference between the Boolean & operator and the && operator?

If an expression involving the Boolean & operator is evaluated, both operands are evaluated. Then the & operator is applied to the operand. When an expression involving the && operator is evaluated, the first operand is evaluated. If the first operand returns a value of true then the second operand is evaluated. The && operator is then applied to the first and second operands. If the first operand evaluates to false, the evaluation of the second operand is skipped.

When a thread is created and started, what is its initial state?

A thread is in the ready state after it has been created and started

 


Comments




Leave a Reply

    Java Sets


    Archives

    July 2008

    RSS Feed