forked from manav88/javaNS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathst1.java
More file actions
55 lines (45 loc) · 1.06 KB
/
st1.java
File metadata and controls
55 lines (45 loc) · 1.06 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
class car {
String name;
int nplate;
float price;
int speed;
void insert(String cname, int no, float pr, int sp) {
name = cname;
nplate = no;
price = pr;
speed = sp;
}
void display() {
System.out.println(name + " " + nplate + " " + price + " " + speed);
}
}
class add {
int a;
int b;
void insert(int c, int d) {
a = c;
b = d;
}
void addi() {
System.out.println(a + b);
}
}
public class st1 {
public static void main(String... arg) {
car c1 = new car();
car dhruv = new car();
car aryan = new car();
car mihir = new car();
add a1 = new add();
a1.insert(88, 880);
a1.addi();
// c1.insert("aston", 88, 40000000, 250);
// dhruv.insert("buggati", 22, 320000000, 330);
// aryan.insert("volvo", 88, 10000000, 200);
// mihir.insert("tesla", 11, 6000000, 150);
// c1.display();
// dhruv.display();
// aryan.display();
// mihir.display();
}
}