Advertisement
Guest User

Untitled

a guest
Dec 13th, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. class Mountain_Bike extends Bicycle
  2. {
  3. int seatheight;
  4.  
  5. public Mountain_Bike(int speed,int gear,int height)
  6. {
  7. super(speed,gear);
  8. seatheight=height;
  9. }
  10. public String toString()
  11. {
  12. return super.toString()+ "seatheight"+ seatheight;// to call parent class(super.toString)
  13. }
  14.  
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement