Correction is above post.
Use this
Main.Gear t =new Main().new Gear();
> Correction is above post.
> Use this
> Main.Gear t =new Main().new Gear();
Explanation: Gear is an inner class, and needs an object of its outer class to
give it nutrients. "new Main()" makes an object of the enclosing class, which
object owns the non-static inner class, so from the object you call "new
Gear()". Your original code did not have an enclosing object around the "new
Gear()".
Incidentally, the virtually universal and Sun-endorsed convention for Java
nomenclature is to name classes with an initial upper-case letter, methods and
non-static-final variables with an initial lower-case letter. The method
"Jam()" would conventionally be named "jam()".
- Lew