} If this way possible, then i would like to know is that readData method will be Synchronized. If one Daemon is calling child1 readData Method and another daemon is calling child2 readData simultaneously, then what will happen.
Joined: Feb 20, 2007
This code wont even compile. A method cannot be defined as 'abstract' and 'synchronized' at the same time, because abstract means that the method doesn't posses a body, while synchronizing is related to method implementation.
author and iconoclast
Yes, there are all sorts of reasons why the above won't compile, but I think what he's really after is something about the different child classes which each have a method, synchronized or not, that override a common synchronized method (it wouldn't need to be abstract.)
The short answer is that inheritance has nothing to do with it. Each individual object has its own "lock" for synchronization. Two threads will be able to call readData() on any two distinct objects simultaneously with no interference, whether those two objects belong to the same class or to two different classes.