But Method can be accessed via object of the class, why is it so, please guide me with a brief explanation ?
But Method can be accessed via object of the class, why is it so, please guide me with a brief explanation ?
Jared Malcolm wrote:You first have to instantiate the class TryCatchTest in order to access a non static member. Just the rules of Java....a static member can't access a non static one. so....
For me though I generally just make a constructor to take the place of the run method. Just gets rid of some unneeded code (in my mind anyway).
But within same class, cant i access methods with out using object of class like c++
Himanshu V Singh wrote:
But Method can be accessed via object of the class, why is it so, please guide me with a brief explanation ?
Rupesh Mhatre wrote:TryCatchTest.run();
Himanshu V Singh wrote:
But within same class, cant i access methods with out using object of class like c++