Advertisement
Guest User

Untitled

a guest
May 26th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.47 KB | None | 0 0
  1. public class VehicleBean {
  2.     String VModel;
  3.     String VManufacturer;
  4.     String VYear;
  5.     MotorBean VMotor;
  6.    
  7.     public VehicleBean() {}
  8.    
  9.     public VehicleBean( String model, String manu, String year, String mc, String cylinders, String ps ) {
  10.         this.VModel = model;
  11.         this.VManufacturer = manu;
  12.         this.VYear = year;
  13.         this.VMotor = new MotorBean( mc, cylinders, ps );
  14.     }
  15.    
  16.     public String getVModel() {
  17.         return VModel;
  18.     }
  19.     public String getVManufacturer() {
  20.         return VManufacturer;
  21.     }
  22.     public String getVYear() {
  23.         return VYear;
  24.     }
  25.     public MotorBean getVMotor() {
  26.         return this.VMotor;
  27.     }
  28.    
  29.     public void setVModel( String model ) {
  30.         this.VModel = model;
  31.     }
  32.     public void setVManufacturer( String manu ) {
  33.         this.VManufacturer = manu;
  34.     }
  35.     public void setVYear( String year ) {
  36.         this.VYear = year;
  37.     }
  38.    
  39.     public String toString() {
  40.         return "";
  41.     }
  42. }
  43.  
  44. class MotorBean {
  45.     String MCc;
  46.     String MNo_cylinders;
  47.     String MPs;
  48.    
  49.     public MotorBean() {}
  50.    
  51.     public MotorBean( String mc, String cylinders, String ps ) {
  52.         this.MCc = mc;
  53.         this.MNo_cylinders = cylinders;
  54.         this.MPs = ps;
  55.     }
  56.    
  57.     public String getMCc() {
  58.         return this.MCc;
  59.     }
  60.     public String getMNo_cylinders() {
  61.         return this.MNo_cylinders;
  62.     }
  63.     public String getMPs() {
  64.         return this.MPs;
  65.     }
  66.    
  67.     public void setMCc( String mc ) {
  68.         this.MCc = mc;
  69.     }
  70.     public void setMNo_cylinders( String cylinders ) {
  71.         this.MNo_cylinders = cylinders;
  72.     }
  73.     public void setMPs( String ps ) {
  74.         this.MPs = ps;
  75.     }
  76. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement