-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoops.java
More file actions
32 lines (26 loc) · 714 Bytes
/
oops.java
File metadata and controls
32 lines (26 loc) · 714 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
import java.util.*;
interface area {
public void rect();
public void circle();
}
public class oops implements area {
int a = 10;
int b = 20;
int r = 2;
public void rect() {
System.out.println("Area of rectangle is 10*20: " + (a * b));
}
public void circle() {
System.out.println("Area of circle is 2*2*3.14: " + (r * r * 3.14));
}
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
int s = sc.nextInt();
System.out.println(s);
oops obj = new oops();
obj.rect();
obj.circle();
System.out.println("Hello World");
sc.close();
}
}