Hai all,
I am new to
java. What is the use of "Abstract Methods", Since we are defining that method in the subclasses,What is the meaning in making it abstract and keeping it in the abstract superclass?
for example:
abstract class A {
abstract void callme(); //line2}
class B extends A {
void callme() {
System.out.println("B's implementation of callme.");
// since anyhow we are defining the method here what is the purpose of line2}
}
class AbstractDemo {
public static void main(
String args[]) {
B b = new B();
b.callme();
b.callmetoo();
}
}
Please help me in this.I know that even a small thing in java is written with some specific purpose. I am unable to understand the purpose of that abstract class.
Thanks in advance,
Santosh Kumar N.