Hi, and thanks in advance to all I tried to implement this example to learn scenario of abstraction practically ? But I am facing 9 nos. of compile time error ? Whats the problem with this code
abstract ClassA{
int x,y;
void method(int x, int y)
{}
abstract void method2();
abstract void method3();
}
ClassB extends ClassA{
void method2()
{
System.out.println("this is Method 2 of class B");
}
void method3()
{
System.out.println("this is Method 3 of class B");
}
}
ClassC extends ClassA{
void method2()
{
System.out.println("this is Method 2 of class C");
}
void method3()
{
System.out.println("this is method 3 of class C");
}
}
public class MainClass {
public static void main(
String[]args){
ClassA obj1 = new ClassB();
obj1.method2();
obj1.method3();
ClassA obj2 = new ClassC();
obj2.method2();
obj2.method3();
}
}