File tree Expand file tree Collapse file tree 2 files changed +22
-8
lines changed Expand file tree Collapse file tree 2 files changed +22
-8
lines changed Original file line number Diff line number Diff line change
1
+ public class Calculator {
2
+ public int add (int a , int b ) {
3
+ return a + b ;
4
+ }
5
+ public int subtract (int a , int b ) {
6
+ return a - b ;
7
+ }
8
+ public int multiply (int a , int b ) {
9
+ return a * b ;
10
+ }
11
+ public int divide (int a , int b ) {
12
+ return b != 0 ? a / b : 0 ;
13
+ }
14
+ }
Original file line number Diff line number Diff line change 1
- public class Student {
1
+ public class Employee {
2
2
private String name ;
3
3
private int age ;
4
- private int roll ;
4
+ private int id ;
5
5
6
6
//constructors
7
- public Student (String name , int age , int rollNo ){
7
+ public Employee (String name , int age , int id ){
8
8
this .name = name ;
9
9
this .age = age ;
10
- this .rollNo = roll ;
10
+ this .id = id ;
11
11
}
12
12
//getters
13
13
public String getName (){
@@ -16,8 +16,8 @@ public String getName(){
16
16
public int getAge (){
17
17
return age ;
18
18
}
19
- public int getRollNo () {
20
- return roll ;
19
+ public int getIDNo () {
20
+ return id ;
21
21
}
22
22
//setters
23
23
public void setName (String name ) {
@@ -26,8 +26,8 @@ public void setName(String name) {
26
26
public void setAge (int age ) {
27
27
this .age = age ;
28
28
}
29
- public void setRollNo (int rollNo ) {
30
- this .rollNo = roll ;
29
+ public void setIDNo (int id ) {
30
+ this .id = id ;
31
31
}
32
32
}
33
33
You can’t perform that action at this time.
0 commit comments