English subtitles

← Find the Error - Intro to Java Programming

Get Embed Code
6 Languages

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

  1. Now actually, when you try to compile the code, you'll get an error. The error
  2. is somewhat curious. It says that gasInTank might not have been initialized.
  3. So, the error here was that gasInTank, by putting the word double here, has
  4. turned into a local variable. Not the instance variable that we intended. Let
  5. me show you another useful way of thinking about instance variables.