Monday, 13 February 2012

What is Downcasting ? | Core Java

Downcasting is the casting from a general to a more specific type, i.e. casting down the hierarchy

What do you understand by private, protected and public? | Core Java

These are accessibility modifiers. Private is the most restrictive, while public is the least restrictive. There is no real difference between protected and the default type (also known as package protected) within the context of the same package, however the protected keyword allows visibility to a derived class in a different package.

If a variable is declared as private, where may the variable be accessed? | Core Java

A private variable may only be accessed within the class in which it is declared.

What is casting? | Core Java

There are two types of casting, casting between primitive numeric types and casting between object references. Casting between numeric types is used to convert larger values, such as double values, to smaller values, such as byte values. Casting between object references is used to refer to an object by a compatible class, interface, or array type reference.

Which non-Unicode letter characters may be used as the first character of an identifier?

The non-Unicode letter characters $ and _ may appear as the first character of an identifier

What restrictions are placed on method overloading?

Two methods may not have the same name and argument list but different return types.

Which class is extended by all other classes?

The Object class is extended by all other classes.