Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package pkgday3;
- class Truck extends Q8{
- int loadingCapacity = 100;
- void modify(){
- this.loadingCapacity=200;
- this.color="White";
- }
- void display(){
- System.out.println("Details: "+this.loadingCapacity+ " "+this.color);
- }
- }
- public class Q8 {
- int vehicleNo=101;
- String model="Eco Sport";
- String manufacturer ="ford";
- String color="black";
- public static void main(String[] args) {
- Truck e = new Truck();
- e.display();
- e.modify();
- e.display();
- }
- }
Add Comment
Please, Sign In to add comment