Skip to content

Commit 858954b

Browse files
Update abstraction.java
1 parent acfd9d2 commit 858954b

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

abstraction.java

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,25 @@
1-
abstract class shape{
1+
abstract class shape
2+
{
23
abstract void draw();
34
}
4-
class rectangle extends shape{
5-
void draw(){
5+
class rectangle extends shape
6+
{
7+
void draw()
8+
{
69
System.out.println("rectanle is drawn");
710
}
811
}
912
class circle extends shape{
10-
void draw(){
13+
void draw()
14+
{
1115
System.out.println("circle is drawn");
1216
}
1317
}
1418

15-
public class abstraction {
16-
public static void main(String[] args) {
19+
public class abstraction
20+
{
21+
public static void main(String[] args)
22+
{
1723
shape s1=new circle();
1824
s1.draw();
1925
}

0 commit comments

Comments
 (0)