Answer Posted / vatsal doshi
The answer is in the question itself.
What is static? Something which belongs to a class and not its objects.
So if in a class, we have some variables, having single copy, we call them static.
Similarly some methods may be actually manipulating these static variables, so those methods are also static.
However, the class itself is static only if it belongs to some class(Definition of static)
So, for a class to be static, it must be a nested class. Such nested classes are called as Top Level Nested Classes in Java.
| Is This Answer Correct ? | 7 Yes | 1 No |
Post New Answer View All Answers
What is an immutable object?
How can you share data between two thread in Java?
Give us the name of the list layoutmanagers in java?
Distinguish between a predicate and a function?
How to disable caching on back button of the browser?
What is substring 1 in java?
What is java used for?
What is square root in java?
What is yield () in java?
What is consumer interface?
What is your platform’s default character encoding?
Why java is considered dynamic?
What is the difference between iterator and list iterator?
What are the features of junit?
In java, how we can disallow serialization of variables?