Welcome to the CSC Q&A, where you can get help (and share your knowledge) about computer science!

How do you differentiate between Instance method and static method

+5 votes
asked Oct 10, 2017 in CSC 211 (F17) by Thomas Ayele (100 points)

2 Answers

0 votes
Best answer
"Static methods are the methods in Java that can be called without creating an object of class and Instance method are methods which require an object of its class to be created before it can be called. To invoke a instance method, we have to create an Object of the class in within which it defined."

you can read more on http://www.geeksforgeeks.org/static-methods-vs-instance-methods-java/
answered Oct 10, 2017 by Jason Dedjoe (100 points)
selected Oct 10, 2017 by Thomas Ayele
0 votes

I think the Static Method refers to the class' static code while the Instance one refers to an object/instance of that class' code. In another word, instance method requires an object of its class to be created before it can be called while static method doesn't require object creation.


answered Oct 10, 2017 by Tiffany Nguyen (100 points)