ocjp 7

Moderator: Site Manager

Post Reply
dikitoa
Posts: 1
Joined: Mon Mar 12, 2018 1:08 pm
Contact:

ocjp 7

Post by dikitoa » Mon Mar 12, 2018 1:13 pm

abstract class Boat {
String doFloat() { return "floating"; }
abstract void doDock();
}
class Sailboat extends Boat {
public static void main(String[] args) {
Boat b = new Sailboat(); // Line A
Boat b2 = new Boat(); // Line B
}
String doFloat() { return "slow float"; } // Line C
void doDock() { } // Line D
}

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests