We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bf93c7c commit f121c08Copy full SHA for f121c08
abstract _class_java
@@ -0,0 +1,44 @@
1
+
2
+//the abstract class can not become a object it is features of it.
3
+abstract class shape
4
+{
5
+ void display()
6
+ {
7
8
+ }
9
+}
10
11
+class cir extends shape{
12
13
14
+ System.out.println("shape is circle is right now");
15
16
17
18
+class rectan extends shape{
19
20
21
+ System.out.println("the shape is rectangle");
22
23
24
+public class abstaract {
25
26
+ public static void main(String[] args)
27
28
29
+ ///abstract class object
30
+ //error like this:'shape' is abstract; cannot be instantiated
31
+ //shape s=new shape();
32
+ // s.display();
33
34
35
+ //instance is cir
36
+ shape s =new cir();
37
+ s.display();
38
39
+ //instance is rectan
40
41
+ s=new rectan();
42
43
44
0 commit comments