Referencing the following example:
class Plane { ... static class Gearbox { ... } } The following is possible:
Plane.Gearbox gearbox = new Plane.Gearbox(); I was wondering if someone could explain what effect the 'static' keyword has in this situation. Coming from C#, this is very strange to me as static classes cannot be instantiated.
I am well aware that there are other questions referring to the same topic, or information online, however I still don't fully understand the use of the 'static' keyword in this situation. Therefore I would greatly appreciate someones help to understand this concept in Java.
staticnested classes have absolutely nothing to do with howstatic classworks in C#. See this official tutorial for an explanation of how they work in Java: docs.oracle.com/javase/tutorial/java/javaOO/nested.html