abstract class A3{
abstract void search();
//no body of statements in abstract method
void print(){
System.out.println("Non Abstract Method");
}
}
class B3 extends A3{
void search(){
System.out.println("Binary Search");
System.out.println("Linear Search");
}
}
class AbstractDemo{
public static void main(String[] a){
B3 b2=new B3();
b2.search();
b2.print();
A3 a2;
B3 b3=new B3();
a2=b3;
a2.print();
}
}
No comments:
Post a Comment