5.6

this Keyword

AP Computer Science A

What is `this`?

Primary use: disambiguating names

What happens without `this`?

When `this` is optional

Using `this` to pass the current object

Using `this` to return the current object

`this` with multiple objects

Trace practice

AP Exam Tips

Common Mistakes

Key Vocabulary