- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSides.java
More file actions
Latest commit
39 lines (38 loc) · 1008 Bytes
/
Copy pathSides.java
File metadata and controls
39 lines (38 loc) · 1008 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
abstractclassShape
{
abstractvoidnumberofsides();
}
classTrapezoidextendsShape
{
voidnumberofsides()
{
System.out.println("Number of sides of Trapeziod is : 4");
}
}
classTriangleextendsShape
{
voidnumberofsides()
{
System.out.println("Number of sides of Triangle is : 3");
}
}
classHexagonextendsShape
{
voidnumberofsides()
{
System.out.println("Number of sides of Hexagon is : 6");
}
}
classSides
{
publicstaticvoidmain(Stringargs[])
{
Shapes;
s=newTrapezoid();
s.numberofsides();
s=newTriangle();
s.numberofsides();
s=newHexagon();
s.numberofsides();
}
}