-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPractice08_OOPs.java
More file actions
142 lines (118 loc) · 2.64 KB
/
Practice08_OOPs.java
File metadata and controls
142 lines (118 loc) · 2.64 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
package com.company;
//1.
//class Employees{
// int id;
// String name;
// int salery;
// public int getId(){
// return id;
// }
// public int getSalery() {
// return salery;
// }
// public String getName() {
// return name;
// }
// public void setName(String n){
// name=n;
// }
//}
//2.
//class phone{
// public void ring(){
// System.out.println("Ringing...");
// }
// public void vib(){
// System.out.println("Vibrating...");
// }
// public void callFriend(){
// System.out.println("Calling Friends");
// }
//3.
//class squareCal{
// int side;
// public int area(){
// int a = side*side;
// return a;
// }
// public int para(){
// int b = 4 * side;
// return b;
// }
//4.
//class rect {
// int length;
// int height;
// public int area(){
// int a = length*height;
// return a;
// }
// public int para(){
// int b = 2*length*height;
// return b;
// }
//}
//5.
//class Tommy{
// public void hit(){
// System.out.println("Hitting the enemy");
// }
// public void fire(){
// System.out.println("Firing to the enemy");
// }
// public void run(){
// System.out.println("Running...");
// }
//}
//6.
//class circle{
// int r;
// public int area(){
// int a = 22/7;
// int b = a*r*r;
// return b;
// }
// public int para(){
// int x = 22/7;
// int y = 2*x*r;
// return y;
// }
//}
public class Practice08_OOPs {
public static void main(String[] args) {
// 1.
// Employees abhay = new Employees();
// abhay.setName("Abhinav Namdeo");
// abhay.id = 12;
// abhay.salery = 4500000;
// System.out.println(abhay.getId());
// System.out.println(abhay.getName());
// System.out.println(abhay.getSalery());
// 2.
// phone oneplus = new phone();
// oneplus.ring();
// oneplus.vib();
// oneplus.callFriend();
// 3.
// squareCal sq = new squareCal();
// sq.side = 5;
// System.out.println(sq.area());
// System.out.println(sq.para());
// 4.
// rect re = new rect();
// re.height = 4;
// re.length = 6;
// System.out.println(re.area());
// System.out.println(re.para());
// 5.
// Tommy tm = new Tommy();
// tm.fire();
// tm.hit();
// tm.run();
// 6.
// circle cr = new circle();
// cr.r = 6;
// System.out.println(cr.area());
// System.out.println(cr.para());
}
}