Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Mountain_Bike extends Bicycle
- {
- int seatheight;
- public Mountain_Bike(int speed,int gear,int height)
- {
- super(speed,gear);
- seatheight=height;
- }
- public String toString()
- {
- return super.toString()+ "seatheight"+ seatheight;// to call parent class(super.toString)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement