I have 2 classes:
gun and machinegun which extends gun
I have 1 arraylist of both gun and machinegun objects. How can i get the objects back out of the arraylist and retain their type?
I'm trying to use an equals method that's in both classes but i only want to compare like classes. (machinegun wouldn't try to match to a gun, only another machinegun)
gun and machinegun which extends gun
I have 1 arraylist of both gun and machinegun objects. How can i get the objects back out of the arraylist and retain their type?
I'm trying to use an equals method that's in both classes but i only want to compare like classes. (machinegun wouldn't try to match to a gun, only another machinegun)