English subtitles

← Unfriend Revisited - Intro to Java Programming

Get Embed Code
5 Languages

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

  1. So, I'll pick up where I left off. I wrote those tests to protect the
  2. functionality of the person class. So, I can run them again to find out which
  3. method's broke when I changed the friends variable. Looks like the first thing
  4. that's broken is that I'm trying to add a string into my array list of person.
  5. So, I no longer need to get the name out of the friend before adding it. If I
  6. run the test, it looks like the getFriends method is still broken. But the
  7. getFriends method that takes a separator is good. The get number of friends
  8. method seems to be working alright still. So I'll need to look at this original
  9. getFriends method. When we run the two string method on the friends array list,
  10. it doesn't have a good way of printing a simple representation for each friend.
  11. I can think of two convenient solutions to this problem. One possibility is to
  12. delete this, and just use the other getFriends method, that we already fixed.
  13. I'll just call getFriends, and pass in a comma and a space as a separator. And
  14. now if I run the test, the getFriends method prints what I would hope.