Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The resulting behavior can be classified as shadowing; the method variable renders the class instance variable inaccessible within the scope of the method. For example, assigning to this.val from within the method does not affect the value of the call instance variable.

Compliant Solution (Field Shadowing)

...