Chandana Garlapati wrote:
why the above code does not give compilation error??
method is non static method and calling from static main..
Can you refer non static method from static content in java?
You can't refer to an instance method from a static method, without using an instance. In this case, you are using an instance, so it is okay.
Henry