sujesh Katri wrote:I used my own naming convention . . .
Very bad idea. An employer will expect you to use their code conventions. Using your own naming conventions means you will write code which other programmers cannot understand.
As Joanne has explained several times lines 24-27 are incorrect.
You should consider the use of getClass() in the equals method. Even I am coming to the belief that it is implicitly incorrect.
As I have already said, the use of those
String literals in the toString method is (in my opinon) poor style.
Using a raw type in lines 76/82 is incorrect.
Returning an Iterator is dangerous.
Why are you counting supertypes? That sounds like something from non‑object‑oriented programming. You should have got them to explain that before you went anywhere near your method. And I can think of a better way to run that loop.
The nest serial number method does not return the next serial number.