Let’s think just a really simple struture for understanding of inheritance concept.
1 |
|
Class A is a super class and Class B is extended Class A. Class C is independent thing. It doesn’t have any relationship with other classes.
1 |
|
You could understand the above code. but let’s see the below, which i haven’t understood well just before now.
1 |
|
The last one is the main topic of this article. I usually think that code would work well. but it’s not. the reason why it isn’t work well is you should understand ArrayList is not extended ArrayList