I don't understand why you're doing any casts at all in that line. The getStories() method returns an int, you want to assign that to an int variable... just do that. Why do you think casting is required there?
Brent Pathakis wrote:
It came up in training, so I wanted to come up with an example (albeit a contrived, and probably invalid one), so I could play with it and get my head wrapped around the concept.
In that case, a good place to start (or to go after you tried it yourself to check your own work) would be to google for java casting examples. Ignore any results that take you to roseindia though. That site is full of misinformation.