6 ♦Syntax for fields?23

Warm ups:

  • Write the syntax pattern for a class with a instance variable (field) and constructor that sets it.
  • Write the syntax pattern for a getter method and a setter method.

Writing Challenge: Write a class called Location that encapsulates an x and a y value. Make appropriate getters and setters for each.