0
How to i know when use static method and when non static? Pleas check my code it dont work without static method. Why?
Probleme static method vs public https://code.sololearn.com/cW4dyRQ8xRBi/?ref=app
2 Answers
+ 10
Main method gets called by the JVM without creating an object. And if you don't have an object, you can only call the method static.
You could instantiated a class and call the method there without using static.
+ 1
thank you for reply