🔒 Closed PaHelp po mga master, rewrite code (Java) to compile

Status
Not open for further replies.

flex012

ØⱧ₳ɎØɄ
Contributor
Patulong lang po mga masterhood ko ..
Abstract Classes and Polymorphism

Using the following class below:
  1. Rewrite the code so that it will compile

Java:
    interface Animal {

        public String eating();
        public int breathing();

}
    abstract class Mammal implements Animal{

        abstract public int sleeping();
        public String eating() { }

}
    class Cat extends Mammal{

}
    public class Main {

        public static void main(){

            Cat cat = new Cat();
            cat.eating();
            cat.breathing();
            cat.sleeping();

    }

}
 
Status
Not open for further replies.

About this Thread

  • 0
    Replies
  • 357
    Views
  • 1
    Participants
Last reply from:
flex012

Trending Topics

Online now

Members online
1,172
Guests online
5,479
Total visitors
6,651

Forum statistics

Threads
2,354,524
Posts
29,383,995
Members
1,079,478
Latest member
Heyanjieee
Back
Top