Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package javaapplication1;
- class A{
- }
- class B extends A{
- void Run()
- {
- System.out.println("B");
- }
- }
- class C extends A{
- void Run()
- {
- System.out.println("C");
- }
- }
- public class New {
- public static void main(String[] args) {
- B obj=new B();
- C obj2=new C();
- obj.Run();
- obj2.Run();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment