-
Notifications
You must be signed in to change notification settings - Fork 0
/
Car.java
38 lines (29 loc) · 1.12 KB
/
Car.java
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
35
36
37
38
import java.util.Scanner;
public class Car implements utility {
int price,seats;
String name,color,brand;
public void setDetails(){
Scanner s = new Scanner(System.in);
System.out.println();
System.out.println("Kindly enter the details");
System.out.print("CAR NAME : ");
name = s.nextLine();
System.out.print("COLOR : ");
color = s.next();
System.out.print("BRAND : ");
brand = s.next();
System.out.print("PRICE : ");
price= s.nextInt();
System.out.print("SEATS : ");
seats = s.nextInt();
System.out.println();
}
public void getDetails(){
System.out.println("CAR NAME : "+name);
System.out.println("COLOR : "+color);
System.out.println("BRAND NAME : "+brand);
System.out.println("PRICE : "+price);
System.out.println("NO. OF SEATS : "+seats);
System.out.println();
}
}