Welcome to the Java Programming Forums

The professional, friendly Java community. 21,500 members and growing!

The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: What is the matching mutator method?

  1. #1
    Junior Member
    Join Date
    Nov 2009
    Thanked 0 Times in 0 Posts

    Default What is the matching mutator method?

    If private String employeeName is an instance variable of a class, write the matching mutator method for it.

  2. #2
    Super Moderator helloworld922's Avatar
    Join Date
    Jun 2009
    Thanked 619 Times in 561 Posts
    Blog Entries

    Default Re: What is the matching mutator method?

    A mutator method is a method that changes a variable inside a class (generally private or protected variables). While technically mutators can change the variables in any way, in general I believe this type of question is refering to a specific type of mutator called a "setter". Setters are exactly like what their name states: the set the value of a variable.

    public void setEmployeeName(String newName)
         this.employeeName = newName;

  3. The Following User Says Thank You to helloworld922 For This Useful Post:

    ssmith (November 3rd, 2009)

Similar Threads

  1. Help with CoinCounter method
    By abielm_007 in forum Java Theory & Questions
    Replies: 2
    Last Post: January 3rd, 2010, 01:19 PM
  2. Any way to map method calls?
    By Swiftslide in forum Collections and Generics
    Replies: 1
    Last Post: September 21st, 2009, 04:37 AM
  3. [SOLVED] Method declaration in Java
    By mohsendeveloper in forum Object Oriented Programming
    Replies: 4
    Last Post: June 11th, 2009, 03:18 AM
  4. Replies: 1
    Last Post: December 30th, 2008, 07:30 AM