Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes static method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "static method" Watch "static method" New topic
Author

static method

srinivas sridaragaddi
Ranch Hand

Joined: Jul 24, 2007
Posts: 225
Hi,



doubt: how come static method main is able to access a non static method infiniteLoop()


SCJP 5.0<br /> <br />"Skills are started with learning and mastered with improvement. Nothing is hereditary except death" BUDDHA...
Freddy Wong
Ranch Hand

Joined: Sep 11, 2006
Posts: 959

Because you use the instance to call the infiniteLoop(). If you call it directly without using the instance, it won't compile.


SCJP 5.0, SCWCD 1.4, SCBCD 1.3, SCDJWS 1.4
My Blog
 
Don't get me started about those stupid light bulbs.
 
subject: static method
 
Similar Threads
whileLoop () ;
Doubt with ++ operator
Dan Chisholm Chapter 4, question 15
byte
no return