Hi All,
While implementing abstract methods in the first concrete subclass, should the overriding priciples be used?.
For example, I found the following code working though I was under the understanding that the signature of the implementing method in the subclass should be the same as that of the Abstract class.
The method has been marked synchronized in the subclass.
Can someone explain this ?
abstract class mytest70{
public abstract void getFireStation();
}
public class mytest71 extends mytest70{
public synchronized void getFireStation()
{
System.out.println("Fire....");
}
public static void main(
String[] args){
mytest71 m = new mytest71();
m.getFireStation();
}
}
Thanks!!