-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patha.java
More file actions
38 lines (36 loc) · 851 Bytes
/
a.java
File metadata and controls
38 lines (36 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
package oops;
import java.util.Scanner;
public class a {
public static void main(String[] args) {
// b obja = new b();
// c obja1 = new c();
// obja.display();
// obja.show();
// obja1.display();
// obja1.show();
// addition with object
Scanner sc = new Scanner(System.in);
int x = sc.nextInt();
int y = sc.nextInt();
int sum=x+y;
System.out.println(sum);
Q objQ = new Q();
objQ.sub(x,y);
objQ.multi(x,y);
objQ.div(x,y);
}
}
class Q{
void add (int x, int y){
System.out.println(x+y);
}
void sub(int x,int y){
System.out.println(x-y);
}
void multi(int x,int y){
System.out.println(x*y);
}
void div(int x ,int y){
System.out.println(x/y);
}
}