Guest User

Untitled

a guest
Jun 24th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. package pkgday3;
  2. class Truck extends Q8{
  3. int loadingCapacity = 100;
  4. void modify(){
  5. this.loadingCapacity=200;
  6. this.color="White";
  7. }
  8. void display(){
  9. System.out.println("Details: "+this.loadingCapacity+ " "+this.color);
  10. }
  11. }
  12. public class Q8 {
  13. int vehicleNo=101;
  14. String model="Eco Sport";
  15. String manufacturer ="ford";
  16. String color="black";
  17. public static void main(String[] args) {
  18. Truck e = new Truck();
  19. e.display();
  20. e.modify();
  21. e.display();
  22. }
  23.  
  24. }
Add Comment
Please, Sign In to add comment