forked from mohammedabdulbari/Java-SE
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAbstractExample.java
More file actions
32 lines (27 loc) · 521 Bytes
/
AbstractExample.java
File metadata and controls
32 lines (27 loc) · 521 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
package abstractexample;
abstract class Super
{
public Super() { System.out.println("Super Constructor"); }
public void meth1()
{
System.out.println("Meth1 of Super");
}
abstract public void meth2();
}
class Sub extends Super
{
@Override
public void meth2()
{
System.out.println("Sub meth2");
}
}
public class AbstractExample
{
public static void main(String[] args)
{
Super s=new Sub();
s.meth1();
s.meth2();
}
}