Your preferences have been saved!
» Method override demo - public class Earth extends Planet {     public static void hide() {         System.out.println("The hide method in Earth.");     }     public void override() {         System.out.println("The override method in Earth.");     }     public static void main(String[] args) {         Earth myEarth = new Earth();         Planet myPlanet = (Planet)myEarth;... 17 Feb 12 » Override Shape - class Shape {   void draw() {     System.out.println(this + ".draw()");   } } class Circle extends Shape {   public String toString() {     return "Circle";   } }... 17 Feb 12 » It only looks like you can override a private or - class WithFinals {   // Identical to "private" alone:   private final void f() {     System.out.println("WithFinals.f()");   }   // Also automatically "final":   private void g() {     System.out.println("WithFinals.g()");   } }... 17 Feb 12 » Polymorphism in Java - import java.util.Random; class Shape {   void draw() {   }   void erase() {   } } class Circle extends Shape {   void draw() {     System.out.println("Circle.draw()");... 17 Feb 12