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 a1d229b commit c584377Copy full SHA for c584377
Interface/AbstractClass1.java
@@ -0,0 +1,38 @@
1
+package Interface;
2
+
3
+abstract class Parent {
4
+ //optional
5
+ Parent()
6
+ {
7
+ System.out.println("Parent Constructor called");
8
+ }
9
+ abstract void meth();
10
+ //Abstract class can also have final methods
11
+ final void meth2()
12
13
+ System.out.println("final method called");
14
15
+}
16
17
+class child extends Parent{
18
+ child()
19
20
+ System.out.println("Child class constructor called");
21
22
+ void meth()
23
24
+ System.out.println("abstract method");
25
26
27
+class AbstractClass1 {
28
+ public static void main(String[] args) {
29
+ child c =new child();
30
+ c.meth();
31
+ c.meth2();
32
+ Parent p=new child();
33
+ p.meth();
34
+ p.meth2();
35
36
37
38
0 commit comments