Two Laptop Bag
The moose likes Beginning Java and the fly likes Difference static and  non static method Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Beginning Java
Reply Bookmark "Difference static and  non static method" Watch "Difference static and  non static method" New topic
Author

Difference static and non static method

amit sharma
Ranch Hand

Joined: Jul 19, 2006
Posts: 129
I want to know the difference between static and non static method except that we can access the static method by class name .How to choose whether method should be declared as static or non static.
Thanks
Jesper de Jong
Java Cowboy
Bartender

Joined: Aug 16, 2005
Posts: 12929
    
    3

See this chapter in The Java Tutorial: Understanding Instance and Class Members


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
suji kumar
Greenhorn

Joined: Nov 08, 2006
Posts: 10
If you need the different copies of variable for different object it has to be made instance variabe(non-static). If you want to share a common variable between every object of that class type, you have to go for static variable
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Difference static and non static method
 
Similar Threads
what does static method mean?
JButton
Static and non Static Synchronize Methods
Static variables and performance....
novice in java,please help!