Question: Revision of mutator method definition

Write a mutator method setAge() that takes a single parameter of type int and sets the value of variable age
Paste your answer in here:

```
public int setAge(int age) 
{
   return age;
}

```

Comments:

```
* Test 1 (0.0 out of 1)

      The compilation was successful
      The output should have been:
          setAge() Correct

      This is what was actually produced:
          setAge() not Correct

```

confused on why i get this error, is it because i have (int age) after setAge that is why the error is comming up?

Answer: 
Try with

```
public void setAge(int age) 
{
  this.age = age;
}

```
Assuming you have a class variable called 'age', you can create the mutator class method as:

```

public class myTest{

public int age;

//other code here..if any

public void setAge(int age) 
{
  this.age = age;
}

//other code here.. if any
}

```

Normally your setAge method should not return anything. Mutator only modifies the value.

To return value you should use getAge() method which is called 'Accessor'.