We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 61d3432 commit 2dd815bCopy full SHA for 2dd815b
1 file changed
Interface.java
@@ -0,0 +1,24 @@
1
+interface Shape{
2
+ int a=4;
3
+ double PI=3.14;
4
+ void area();
5
+}
6
+class Circle implements Shape{
7
+ public void area(){
8
+ System.out.println("The area of circle is "+(PI*a*a));
9
+ }
10
11
+class Square implements Shape{
12
13
+ System.out.println("The area of square is "+(a*a));
14
15
16
+
17
+public class Interface {
18
+ public static void main(String args[]){
19
+ Circle c = new Circle();
20
+ Square s = new Square();
21
+ c.area();
22
+ s.area();
23
24
0 commit comments