Return to Video

Implementing Subclass Methods - Intro to Java Programming

  • 0:00 - 0:05
    Let's get started with implementing the missing methods in the subclass. We'll
  • 0:05 - 0:09
    start with the addChoice method in the display method I've given you a stop gap
  • 0:09 - 0:14
    implementation we'll refine that later. In the addChoice method we need to add
  • 0:14 - 0:19
    the new choice one of the multiple choices somewhere where as some where. We
  • 0:19 - 0:23
    actually also need to have an instance variable to collect the choices, we'll
  • 0:23 - 0:28
    just collect them in an ArrayList of strings. One entry per choice that means
  • 0:28 - 0:32
    you needed to clear that instance variable in the choice question class and you
  • 0:32 - 0:38
    also need to initialize the instance variable in the constructor. Once you've
  • 0:38 - 0:41
    done those things you can turn back to the addChoice method and simply add the
  • 0:41 - 0:46
    choice. There's the second parameter that indicates whether the choice is
  • 0:46 - 0:50
    correct or not. We'll take that one up in just a minute. At this stage, just
  • 0:50 - 0:53
    leave it alone. So go ahead and do those three things and then we'll compare
  • 0:53 - 0:54
    notes.
Title:
Implementing Subclass Methods - Intro to Java Programming
Description:

more » « less
Video Language:
English
Team:
Udacity
Project:
cs046: Intro to Programming
Duration:
0:57

English subtitles

Revisions Compare revisions