Saik0 Saik0 - 1 year ago 91
Java Question

Static option is disabled while creating a new Java class in Eclipse

When I try to create a new Java class in Eclipse, under the "Modifiers" section

option is shown as disabled. Why is that?

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download