Overriding abstract in java

126
-1

Published on

WAP of method overriding by using abstract methods in java

Published in: Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
126
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
8
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Overriding abstract in java

  1. 1. //Ques. 14 WAP of method overriding by using abstract methods. importjava.util.*; class A { public String title; voidgetA() { System.out.println("n t t Thought Of The Day"); } } class B extends A { public String title; voidgetB() { getA(); System.out.println("n Try And Fail"); } } class C extends A { public String title; voidgetC() { System.out.println("n But Never fail To Try"); } }
  2. 2. classAdemo { public static void main(String arr[]) { B b = new B(); C c = new C(); b.getB(); c.getC(); } } OUTPUT:-

×