We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a493592 commit f7fd2c7Copy full SHA for f7fd2c7
Practicals/poly.java
@@ -0,0 +1,36 @@
1
+class shape {
2
+ void getShape() {
3
+ System.out.println("This is a shape");
4
+ }
5
+ void hi()
6
+ {
7
+ System.out.println("hi");
8
9
+}
10
+class circle extends shape{
11
12
+ System.out.println("This is circle");
13
14
15
+class rectangle extends shape {
16
17
+ System.out.println("This is rectangle");
18
19
20
+class triangle extends shape {
21
22
+ System.out.println("This is triangle");
23
24
25
+public class poly {
26
+ public static void main(String[] args) {
27
+ shape s=new shape();
28
+ shape c=new circle();
29
+ shape r=new rectangle();
30
+ shape t=new triangle();
31
+ s.getShape();
32
+ c.getShape();
33
+ r.getShape();
34
+ t.getShape();
35
36
0 commit comments