Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- abstract class abc
- {
- abstract void callme();
- void callmethod()
- {
- System.out.println("I am in callmethod");
- }
- }
- class xyz extends abc
- {
- void callme()
- {
- System.out.println("I am in callme()");
- }
- }
- public class Demo
- {
- public static void main(String[] args)
- {
- abc ob;
- xyz obj=new xyz();
- obj.callmethod();
- obj.callme();
- ob=obj;
- ob.callmethod();
- ob.callme();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement