• Post Reply Bookmark Topic Watch Topic
  • New Topic

Movie Character Generator  RSS feed

Ranch Hand
Posts: 117
Chrome Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is one of the exercises from Thinking in Java:

Create a generator that produces character names from your favorite movies (you can use Snow White or Star Wars as a fallback) and loops around to the beginning when it runs out of names. Use the utilities in com.bruceeckel.util to fill an array, an ArrayList, a LinkedList, and both types of Set, then print each container.

A while back Steve Luke told me about Enum Types, so that's what I used in my program:

I did not use com.bruceeckel.util to fill an Array, since the enum type solves the problem. The program works, was simple enough to write, and does what was expected. Does this look right to you? Would you do it any differently?
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!