Question: What is the difference between a static method and an instance method?Answer: A static method belongs to the class and can be called without creating an instance, while an instance method operates on an instance of the class and requires an object to be created.Example:
|
Is it helpful?
Yes
No
Most helpful rated by users:
- What is the difference between a stack and a queue?
- What is the purpose of an index in a database?
- What is the purpose of the \'git\' version control system?