Write an assignment statement to set localVar
to this value
[i.e. the square root of instanceVar
].
localVar = Math.sqrt(this.instanceVar);or
localVar = Math.sqrt(instanceVar);(Again, the
this.
isn't required by Java, but I prefer it.)
localVar
on the right side of the
equals sign, and Math.sqrt(this.instanceVar)
on the
left, e.g.
Math.sqrt(this.instanceVar) = localVar;
this.
in front of localVar
, e.g.
this.localVar = Math.sqrt(this.instanceVar);
this.instanceVar
refers to the
instanceVar
part of an object named
this
. But localVar
isn't part of
anything larger; it's just a variable used temporarily during this one
method.