Advertisement
Guest User

Untitled

a guest
Jan 18th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. package interfaces;
  2.  
  3. public class VehicelChassis implements Chassis{
  4. String ChassisName;
  5.  
  6. public static void main(String[] args) {
  7. VehicelChassis VC1 = new VehicelChassis();
  8. VehicelChassis VC2 = new VehicelChassis("Test Chassis");
  9.  
  10. System.out.println(VC1);
  11. System.out.println(VC2);
  12.  
  13. }
  14.  
  15. public VehicelChassis(){
  16. this.ChassisName = Chassis.chassis;
  17. }
  18.  
  19. public VehicelChassis(String chassis){
  20. this.ChassisName = chassis;
  21. }
  22.  
  23. @Override
  24. public Chassis getChassisType() {
  25.  
  26. return this;
  27. }
  28.  
  29. @Override
  30. public void setChassisType(String VehicelChassis) {
  31. this.ChassisName = VehicelChassis;
  32.  
  33. }
  34.  
  35. public String toString(){
  36. return "Vehicelchassis: " + this.ChassisName;
  37. }
  38.  
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement