Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- abstract class hewan{
- abstract void makan();
- }
- class kucing extends hewan{
- void makan() {
- System.out.println("Kucing makan ikan");
- }
- }
- class tikus extends hewan{
- void makan() {
- System.out.println("Tikus makan kue");
- }
- }
- class abstraction{
- public static void main(String args[]) {
- hewan h;
- h = new kucing();
- h.makan();
- h = new tikus();
- h.makan();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement