Points to Remember

• Everything from the start marker of a comment block (e.g. /*)

is ignored until the first occurrence of the matching end marker (*/).

• The "throw" statement can only throw "Throwable" objects.

A NullPointerException will be thrown if the Exception given to the

"throw" statement results in null.

• In the same statement you can use decimal, octal and/or hexadecimal statements.

• While creating a multidimensional array, dimensions must be

created left to right. So, int [] [] array = new int [] [4]; is not valid.

• Elements of an un-initialized array object get the default value

corresponding to the type of the elements. Whether the array object

reference is a local or member variable, does not matter.

• In a switch statement the type of the case labels must be assignable to

the type of switch expression.

• It is not possible to break out of an "if" statement. If the "if" statement is placed

within a labeled block, a switch statement or a loop construct, the usage of "break"

would be valid.

• The "if" statement does not return any value.

• "continue" cannot be used outside the context of a loop.

• A variable declared in a "try" block is not visible in "catch" or "finally" block.

• If C extends B and B extends A, then it is not possible to call a method of A

( implemented in all the three classes ) from an instance method in class C.

• An object that has been eligible for garbage collection may stop being

eligible for garbage collection and return to normal life. This happens

if the call to the finalize() reestablishes a reference from the active part

of the program to the object.

• If a class has a final blank variable, then it must be initialized when an

instance is created ( in all the constructors or any initializer ) , or else

the code will fail to compile.

• A thread's status (user or daemon) can be changed before the thread

is started. Changing the status of a thread already started throws

IllegalStateException.

0 comments:

Post a Comment