Now that we have our object firstPerson, let’s set its field values. To do so, we call the field we wish to set on the object whose field we wish to set.
Let’s set the name, gender, and age of the object firstPerson.
123
firstPerson.name = "Sarah"
firstPerson.gender = "female"
firstPerson.age = 25
To print the field values, we pass object.field to a print method.