Class inside a Method ? Is it possible ?… Yes, Possible…

Hi Friends,
Here we are going to create a class inside a method, and , a class in a method is called Local Class.

In the following code, we have created a class “LocalClass” within “show()” method and then have a “displayVal()” Method inside LocalClass. Continue reading


“covariant return type” means ?

Hi friendzz,

We have return type in our methods, but what is covariant return type?
Let’s have an example.

Suppose that you have a class hierarchy in which Object is a superclass of java.lang.Number, which is in turn a superclass of ImaginaryNumber. Continue reading