When I try to create a new Java class in Eclipse, under the "Modifiers" section static option is shown as disabled. Why is that?
The static modifier means a member (be it a field, a method or an inner class) belongs to the class instead of to a specific instance of it. A top level class does not belong to anything (it is not within another class), and thus cannot be static. Only an inner class can be static.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With