Java - problems with polymorphism
Posted
by cc0
on Stack Overflow
See other posts from Stack Overflow
or by cc0
Published on 2010-03-16T16:18:20Z
Indexed on
2010/03/16
16:21 UTC
Read the original article
Hit count: 200
I have a book class, then a novel- and a science book class that extend the book class.
I made an ArrayList using the book class, then inserted the novels and the science books into that. Now I'm trying to iterate through the ArrayList to count how many novels are there. How can I tell?
Would love to see some examples of this! I've been at it for a while.
© Stack Overflow or respective owner