English subtitles

← Pitfall - Intro to Java Programming

Get Embed Code
7 Languages

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

  1. Sometimes mutators are useful. But they can be tricky to think about. For
  2. example, what does this sequence of statements make? First, we create a
  3. variable box of type Rectangle, and put a Rectangle in it. Then, we create
  4. another variable of the same type, but I want it to be the same. So, I'm just
  5. going to use box. Now, I actually realize I need to get the original box out of
  6. the way. So, I'm just going to translate it. So, this would look something
  7. like, we would create a rectangle. And then, we create another rectangle that's
  8. the same. Then, we translate it out of the way. What is the value of box.getX?
  9. What is the value of box2.getX?