Cinder1986

Untitled

Feb 19th, 2023
557
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.71 KB | None | 0 0
  1. public class Main {
  2.  
  3.     class Engine{
  4.         private int cylinders, horsepower, torque;
  5.         private String manufacturer;
  6.     }
  7.  
  8.     class Transport {
  9.         protected String brand, model, color, interior, ownerName, modifications, specifications;
  10.         protected int seats, startYear, mileage, mass;
  11.     }
  12.  
  13.     class AirTransport extends Transport {
  14.         protected int maxHeight, maxDistance;
  15.     }
  16.  
  17.     class Helicopter extends AirTransport {
  18.         private int blades;
  19.         private String rotorsType;
  20.         private Engine engine;
  21.     }
  22.  
  23.     class Airplane extends AirTransport {
  24.         private String airplaneClass;
  25.         private Engine[] engines;
  26.         private int landings;
  27.     }
  28.  
  29.     class SeaTransport extends Transport {
  30.         protected int volumeDisplacement, massDisplacement, normalDisplacement, fullDisplacement;
  31.         protected Engine engine;
  32.     }
  33.  
  34.     class Trailer extends Transport {
  35.         private String trailerType;
  36.     }
  37.     class GroundTransport extends Transport {
  38.         protected int wheels, fuelTankVolume, highwayConsumption, cityConsumption, gears;
  39.         protected String wheelDrive, gearboxType, gearboxManufacturer, soundSystem;
  40.         protected Engine engine;
  41.         protected boolean leftSided;
  42.     }
  43.  
  44.     class PassengerCar extends GroundTransport {
  45.         private String bodyType, rimsType, tyresType, assembly, equipment;
  46.         private int rimsRadius, acceleration;
  47.         private Trailer trailer;
  48.     }
  49.  
  50.     class Truck extends GroundTransport {
  51.         private Trailer trailer;
  52.         private String trailerConnection;
  53.     }
  54.     public static void main(String[] args) {
  55.         System.out.println("Hello world!");
  56.     }
  57. }
Tags: OOP Lab1
Advertisement
Add Comment
Please, Sign In to add comment