Can we use it like this? Why or why not? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
16th Nov 2019, 4:28 AM
palak pandey
palak pandey - avatar
2 Respostas
+ 3
You cannot keep a top level class as static in Java but you can keep a class static if it is inside another class. This is useful because then you don't have to create an instance of the top level class to access the methods of the inner class.
16th Nov 2019, 4:51 AM
Avinesh
Avinesh - avatar
+ 1
Well we can declare classes static.
16th Nov 2019, 4:49 AM
palak pandey
palak pandey - avatar