Advertisement
Guest User

Untitled

a guest
Nov 18th, 2018
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1.  
  2. package Srabon;
  3.  
  4. public class Toyota extends Car {
  5. double price;
  6. String year;
  7. int number;
  8. public Toyota(double price,String year,int number,String model,String company,Engine eng,Dashboard das)
  9. {
  10. super(model,company);
  11. this.price=price;
  12. this.year=year;
  13. this.number=number;
  14. this.eng=eng;
  15. this.das=das;
  16. }
  17. public void changefuel()
  18. {
  19. System.out.println("ChangeFuel method");
  20. }
  21. public void changebattery()
  22. {
  23. System.out.println("Change battery method");
  24. }
  25. public void display()
  26. {
  27. System.out.println("price "+price);
  28. System.out.println("year "+year);
  29. System.out.println("number "+number);
  30. System.out.println("model "+model);
  31. System.out.println("company "+company);
  32. System.out.println("Capacity "+eng.cap);
  33. System.out.println("company "+das.size);
  34. }
  35.  
  36.  
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement