In the above four,Some but not all, will compile. All of those that compile will throw an exception at runtime.
Given the options, in the above program, watever code I insert, fornew Retread.doStuff() it gives me a compiler error "Retread.doStuff() cannot be resolved to a type" Instead of new Retread.doStuff() if I do
It works fine,and the answer look correct to me.
Also I see that doStuff() being a nonstatic method, we are able to call from static method. Can anyone explain me this behavior, Thank you.