Sub-classing in Java Programming

Sub-classing in Java Programming

Previous Home Next

 

 A Java subclass is a class which inherits a method or methods from a Java super class.

Sub-classing in Java Programming
 


 
public class Demo
{
public void message()
{
System.out.println("A very simple example of overriding");
}
}

public class Advice extends Demo { //subclass in java programming.
// override concept is utilize.
public void message() {
System.out.println("Warning: overriding can be done.");
}
}


Previous Home Next