0
Where to use the static
3 Respostas
+ 13
static for a method is used so that U don't need to create an object of a class to access that method .
https://www.sololearn.com/learn/Java/2159/?ref=app
👉have look at my code , might it'll solve all doubts
https://code.sololearn.com/cvfs7727ltDG/?ref=app
+ 2
Static is used in a class, if you want that variable to be global. It means that variable will have the same value in every program. Use it if you want that variable to be associated with the class, but not tied to a single instance.
0
thanks