// Arbitrary ordering of the field and method declarations within the class // There however is still just one constructor // // This file is a modification on the GeoTester.jf // // Methods: // - can be overriden (replace a superclass's method with a specialized one). // - cannot be overloaded(several methods of the same name in a single class). // // Constructors: // - must call super() explicitly. // - can only have one constructor per class. // // Declarations: // - All classes must be declared public. // - no assignment at declaration: int foo = 5; // - Cannot do: Circle myCircle = new Circle(10); // Must break into: // Circle myCircle; // myCircle = new Circle(10); // // MethodInvocation: // foo.bar(); should work. // foo[1].bar(); will work. // (foo).bar(); will work. // public class ArbitraryOrder { public boolean amItransparent() { // Lets start with a method declaration return isTransparent; } public int calculateArea() {return 0;} // Another method declaration public boolean isTransparent; // Field declaration next public ArbitraryOrder () { // Now comes the sole constructor super(); isTransparent = true; } public boolean WhatisTransparent; // Another field declaration public boolean WhatIstransparent() { // Method return isTransparent; } public int calculateArea() {return 0;} public int calculateVolume() {return 0;} public boolean isTransparent; // Another field declaration just for fun // public int magicNumber() {return 0;} }