Thursday, August 17, 2017

abstract


package javaapplication18;
abstract class animal{
    abstract void eat();
    abstract void run();
    void b(){
       
    }
    abstract  void a();
}
class lion extends animal{
    public void big()
    {
        System.out.println("king");
    }

    @Override
    void eat() {
        System.out.println("Meat");
    }

    @Override
    void run() {
        System.out.println("Fast");
      }

    @Override
    void a() {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }
}
class cow extends animal{

    @Override
    void eat() {
        }

    @Override
    void run() {
    }

    @Override
    void a() {
        throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
    }
   
}

public class JavaApplication18 {
    public static void main(String[] args) {
     

    }
   
}

No comments:

Post a Comment