I want to ask you how can i copy firstClass objects to secondClass objects?
Is this possible to figure it out by using clone()?
The situation looks like this:
I have a class f.x. firstClass. And I need to clone firstClass objects to secondClass objects (and these cloned objects must be stored into array)
Thanks
EDITED:
sorry for a little information. But my task looks like this:
Write a Garage class whose objects can hold up to some number of Vehicle objects in an array. Make Garage a Cloneable type, and write a proper clone method for it. Write a Garage.main method to test it.
firstClassandsecondClasslook like? does one inherit from another?