_MuradPro_

Bus

Sep 28th, 2020
776
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. public class Bus {
  3.     private int bus_name;
  4.     private int capasity;
  5.    
  6.     public Bus(int bus_name, int capasity) {
  7.         this.bus_name = bus_name;
  8.         this.capasity = capasity;
  9.     }
  10.    
  11.     public String toString() {
  12.         return "The bus number " + bus_name + " has " + capasity + " places";
  13.     }
  14.  
  15.     public int getBus_name() {
  16.         return bus_name;
  17.     }
  18.  
  19.     public void setBus_name(int bus_name) {
  20.         this.bus_name = bus_name;
  21.     }
  22.  
  23.     public int getCapasity() {
  24.         return capasity;
  25.     }
  26.  
  27.     public void setCapasity(int capasity) {
  28.         this.capasity = capasity;
  29.     }
  30.    
  31.    
  32. }
  33.  
RAW Paste Data