Monday, 13 February 2012

What does it mean that a class or member is final? | Core Java

A final class cannot be inherited. A final method cannot be overridden in a subclass. A final field cannot be changed after it's initialized, and it must include an initializer statement where it's declared.

How are this() and super() used with constructors? | Core Java

this() is used to invoke a constructor of the same class. super() is used to invoke a superclass constructor.

What is the difference between a break statement and a continue statement? | Core Java

A break statement results in the termination of the statement to which it applies (switch, for, do, or while). A continue statement is used to end the current loop iteration and return control to the loop statement.

What is the difference between a field variable and a local variable? | Core Java

A field variable is a variable that is declared as a member of a class. A local variable is a variable that is declared local to a method.

What is the difference between the Boolean & operator and the && operator? | Core Java

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.

Which Java operator is right associative? | Core Java

The = operator is right associative.

What is constructor chaining and how is it achieved in Java ? | Core Java

A child object constructor always first needs to construct its parent (which in turn calls its
parent constructor.). In Java it is done via an implicit call to the no-args constructor as the
first statement.