You are on page 1of 1

AbstractDemo.

java

1 package AbsClass;
2
3 abstract class A
4{
5 void Method2()
6 {
7 System.out.println("We have a concrete method here.");
8 }
9}
10
11 class B extends A
12 {
13 void Method1()
14 {
15 System.out.println("This is a method of class A");
16 }
17 }
18
19 public class AbstractDemo {
20
21 public static void main(String args[])
22 {
23 B b = new B();
24 b.Method1();
25 b.Method2();
26 }
27
28 }
29

Page 1

You might also like