saykotislam

201-15-13993

Mar 5th, 2021
44
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package vehicle;
  2. import java.util.Scanner;
  3. class MotorVehicle{
  4.  private int numberOfWheels;
  5.  private int numberOfSeats;
  6.  private String nameOfRoute ;
  7.  Scanner a=new Scanner(System.in);
  8.  void set()
  9.        {
  10.        int Wheels= a.nextInt();
  11.        int Seats= a.nextInt();
  12.        String d=a.nextLine();
  13.        String Route=a.nextLine();
  14.        
  15.    }
  16.  public void setm(int Wheels,int Seats,String Route){
  17.      numberOfWheels=Wheels;
  18.      numberOfSeats= Seats;
  19.      nameOfRoute=Route;
  20.      
  21.      System.out.println(Wheels);
  22.      System.out.println(Seats);
  23.      System.out.println(Route);
  24.      
  25.       }
  26.  }
  27.  
  28. class Bus extends MotorVehicle{
  29.    
  30. int engineNumber;
  31. String brandName;
  32. int licenseNumber ;
  33. }
  34.  
  35. class Truck extends MotorVehicle{
  36. int engineNumber;
  37. String brandName;
  38. int licenseNumber ;
  39. }
  40.  
  41. public class Vehicle {
  42.  
  43.    public static void main(String[] args) {
  44.        Scanner a=new Scanner(System.in);
  45.            
  46.        MotorVehicle b= new MotorVehicle();
  47.        b.set();
  48.        b.setm(b., 0, Route);
  49.        
  50.    
  51.        
  52.     }
  53.    
  54. }
RAW Paste Data