Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Car_BMW;
- public class BMW extends Date{
- public String name;
- public int model;
- public double engine;
- public String color;
- public double price;
- Date Date;
- public void bmw(String name,int model,int engine,String color,double price,Date Date)
- {
- this.name = name;
- this.model = model;
- this.engine = engine;
- this.color = color;
- this.price = price;
- this.Date =Date;
- }
- public void print_all()
- {
- // System.out.println("تاريخ اليوم");
- // System.out.print(day+"/"+month+"/"+year);
- System.out.println("\n");
- System.out.print("اسم السيارة "+" "+"-->"+" ");
- System.out.print(name);
- System.out.println("\n");
- System.out.print("موديل السيارة"+" "+"-->"+" ");
- System.out.print(model);
- System.out.println("\n");
- System.out.print("قوة المحرك"+" "+"-->"+" ");
- System.out.print(engine);
- System.out.println("\n");
- System.out.print("اللون"+" "+"-->"+" ");
- System.out.print(color);
- System.out.println("\n");
- System.out.print("السعر"+" "+"-->"+" ");
- System.out.print(price);
- System.out.println("\n");
- }
- }
- -----------------------------------------------------------------
- package Car_BMW;
- public class Date {
- public int day,month,year;
- public void Date(int day,int month,int year)
- {
- this.day = day;
- this.month = month;
- this.year = year;
- }
- public void print()
- {
- System.out.println("تاريخ اليوم");
- System.out.print(day+"/"+month+"/"+year);
- }
- }
- ----------------------------------------------------------------
- package Cars;
- import Car_BMW.BMW;
- import Print.Print;
- import Car_BMW.Date;
- import features.features;
- // M.bmw("X1", 2004,6, "Black", 25000);
- // P.print_all();
- // F.print_f();
- public class Cars{
- public static void main(String[] args) {
- BMW M = new BMW();
- Date D =new Date();
- Print P =new Print();
- features F = new features();
- D.Date(6, 4, 2021);
- M.bmw("X1", 2004,6, "Black", 25000, D);
- D.print();
- M.print_all();
- }
- }
Advertisement
RAW Paste Data
Copied
Advertisement