Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package javaapplication15;
- abstract class A
- {
- public A() {
- System.out.println("This is constructor of abstract class");
- }
- abstract void a_method();
- public void non_method()
- {
- System.out.println("This is a normal method of abstract class");
- }
- }
- class B extends A{
- @Override
- void a_method() {
- System.out.println("This is abstract method");
- }
- public static void main(String[] args) {
- A q = new B();
- q.a_method();
- q.non_method();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement