Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
287 B
3
Indexable
Never
public class Vehicle{
  int displacement = 0;
}

public class Car{
  public Car(){
    Vehicle v = new Vehicle();
    v.setDisplacement(10);
  }
}

public class Bike{
  int displacement = 0;
   public Bike(){
    Vehicle v = new Vehicle();
    v.getDisplacement();
  }
}
Leave a Comment