I am using JComboBox with a custom class object, and the equals method is over-ridden, and integrated very deeply into the code.
The problem is that if two objects are e
No, not without being type-unsafe. But you can cast Vector
to Vector extends Clas_2>
though which should solve your problem.
Since Clas_2
is a parent class of Clas_1
, anything you get
from a Vector
is an instance of Clas_2
, but you cannot add
any Clas_2
to a Vector
since not all instances of of Clas_2
are instances of Clas_1
. The extends
syntax makes that distinction.