Monday, 13 February 2012

What is a local, member and a class variable?

Variables declared within a method are "local" variables. Variables declared within the class i.e not within any methods are "member" variables (global variables). Variables declared within the class i.e not within any methods and are defined as "static" are class variables

What modifiers are allowed for methods in an Interface?

Only public and abstract modifiers are allowed for methods in interfaces.

What is Externalizable?

Externalizable is an Interface that extends Serializable Interface. And sends data into Streams in Compressed Format. It has two methods, writeExternal(ObjectOuput out) and readExternal(ObjectInput in)

Why does Java not support operator overloading?

Operator overloading makes the code very difficult to read and maintain. To maintain code simplicity, Java doesn't support operator overloading.

If i only change the return type, does the method become overloaded?

No it doesn't. There should be a change in method arguements for a method to be overloaded.

What is a Marker Interface?

An Interface which doesn't have any declaration inside but still enforces a mechanism.

Which OO Concept is achieved by using overloading and overriding?

Polymorphism.