Share on Google+Share on Google+

Abstract class or methods example-2

In this example you will see that an abstract class can extend another abstract class.
package roseindia1;

abstract class Lion {
  abstract void runLion()// defined in the non abstract class

abstract class Lion1 extends Lion {
  abstract void runLion1()// defined in the non abstract class

class BuzzwordLion extends Lion1 {
  void runLion() {
    .println(" Defining the defination of abstract method runLion()");

  void runLion1() {
    .println(" Defining the defination of abstract method runLion1()");


class AbstractExample1 {
  public static void main(String[] args) {
    BuzzwordLion b = new BuzzwordLion();

 * --------------------Output-------------------- 
 *  Defining the defination of abstract method runLion()
 *  Defining the defination of abstract method runLion1()



Posted on: June 30, 2010 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.