X932: Using a Mutator 1

For this problem assume you have access to a Person class defined here:

public class Person
{
    private double moneyInWallet;
    private int age;

    public void setAge(int a)
    {
        age = a;
    }

    public void setMoneyInWallet(double s)
    {
        moneyInWallet = s;
    }
}

Below you've been given a method and a Person object has been created. Using the methods defined above, set age to 42 and money in wallet to 12.34.

Your Answer:

Reset

Practice a different Java exercise

Feedback

Your feedback will appear here when you check your answer.