Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

problem in understanding the concept of static method  RSS feed

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I know that static method cannot use non-static methods .
Then how the following code works ,where main method is static and this main method calls go() method which is a non-static method .


Thanks
 
lowercase baba
Bartender
Posts: 12613
50
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
because you have created a SimpleGuib object, and you are calling the method go() on that object.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!