-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFirst.java
More file actions
44 lines (34 loc) · 851 Bytes
/
First.java
File metadata and controls
44 lines (34 loc) · 851 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
35
36
37
38
39
40
41
42
43
44
class Arithematic{
public int No1,No2;
public Arithematic(){
this.No1 = 0;
this.No2 = 0;
}
public Arithematic(int Value1 , int Value2){
this.No1 = Value1;
this.No2 = Value2;
}
public int Addition()
{
int Ans = 0;
Ans = this.No1 + this.No2 ;
return Ans;
}
public int Substraction()
{
int Ans = 0;
Ans = this.No1 - this.No2 ;
return Ans;
}
}
class First{
public static void main(String A[])
{
int Result = 0;
Arithematic aobj = new Arithematic(11,10);
Result = aobj.Addition();
System.out.println("Addition is : "+Result);
Result = aobj.Substraction();
System.out.println("Substraction is : "+Result);
}
}