Hello everyone. I have created a class in Java named Farm which contains a list of animals(cow,pig and chick).
myFarm is an array of object of Farm class containing objects of NamedCow,pig and chick class.
I have not understand one line in my code: NamedCow named = (NamedCow)myFarm.get(0);
here what is the meaning of the NamedCow enclosed within parentheses in the right side. Cn anyone please tell me??
Edited 2 Years Ago by SK33