// File: StaticExample5.java // // Author: Rahul Simha // Created: August 19, 1998 // Modified: Sept 2007 // // Illustrates function overriding in static classes public class StaticExample5 extends StaticExample { // A new function that overrides the parent's printx() static void printx () { System.out.println ("The value of x is " + x); } public static void main (String[] argv) { x = 5.34; // The variable x is inherited. printx (); // The printx function in this class. StaticExample.printx(); // The parent's function is still accessible. } }