-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCar.java
More file actions
34 lines (31 loc) · 957 Bytes
/
Car.java
File metadata and controls
34 lines (31 loc) · 957 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
public class Car {
int wheels;
int Doors;
int maxSpeed;
String name;
String modelNumber;
String company;
public Car(int wheels,int Doors,int maxSpeed,String name,String modelNumber,String company) {
this.wheels=wheels;
this.maxSpeed=maxSpeed;
this.Doors=Doors;
this.name=name;
this.modelNumber=modelNumber;
this.company=company;
}
@Override
public String toString() {
return "Car{" +
"wheels=" + wheels +
", Doors=" + Doors +
", maxSpeed=" + maxSpeed +
", name='" + name + '\'' +
", modelNumber='" + modelNumber + '\'' +
", company='" + company + '\'' +
'}';
}
public static void main(String[] args) {
Car swift=new Car(4,4,210,"BMW9i","fej345","BMW");
System.out.println(swift);
}
}