English subtitles

← Implementing Subclass Methods - Intro to Java Programming

Get Embed Code
6 Languages

Showing Revision 4 created 05/25/2016 by Udacity Robot.

  1. Let's get started with implementing the missing methods in the subclass. We'll
  2. start with the addChoice method in the display method I've given you a stop gap
  3. implementation we'll refine that later. In the addChoice method we need to add
  4. the new choice one of the multiple choices somewhere where as some where. We
  5. actually also need to have an instance variable to collect the choices, we'll
  6. just collect them in an ArrayList of strings. One entry per choice that means
  7. you needed to clear that instance variable in the choice question class and you
  8. also need to initialize the instance variable in the constructor. Once you've
  9. done those things you can turn back to the addChoice method and simply add the
  10. choice. There's the second parameter that indicates whether the choice is
  11. correct or not. We'll take that one up in just a minute. At this stage, just
  12. leave it alone. So go ahead and do those three things and then we'll compare
  13. notes.