Originally posted by Doit:
Can some one please answer ???
I think static method can be accesed through object reference also.
- Thanks.
Static methods can be called by using the class name or by using an object reference( As in Thread.yield()or t.yield() where t is a reference to a thread. Within a class that extends Thread
yield() can be called with it's signature only ). For clarity it is usually better to use the class name as this makes it clear that the method is static. Both 1 and 2 in the question are correct.