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: classes and methods??

  1. #1
    Junior Member
    Join Date
    May 2011
    Thanked 0 Times in 0 Posts

    Default classes and methods??

    hi everyone, im kind of new to the java world and already confused!

    i understand that there are different classes but am confused as to what method i would use to set/obtain values from that class?

    So, to set the values of private data of a class what method would i use? abstract? mutator? static?

    Its all very confusing to me, any help or advice would be appriciated!


  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Thanked 833 Times in 772 Posts
    Blog Entries

    Default Re: classes and methods??

    Do a google search for accessor and mutator methods...it should turn up many examples. For example:
    Accessors and Mutators

    In general for a private variable, you have a set* and get* (where * is the name of the variable) to retrieve and set the variable.

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

    paddy1 (May 20th, 2011)

Similar Threads

  1. Need Help with using classes [HELP]
    By dragon40226 in forum Java Theory & Questions
    Replies: 4
    Last Post: May 19th, 2011, 01:59 PM
  2. [SOLVED] Help with Classes/ Instance Methods
    By Stockholm Syndrome in forum What's Wrong With My Code?
    Replies: 8
    Last Post: March 9th, 2011, 06:33 PM
  3. Classes problem
    By Skyton in forum What's Wrong With My Code?
    Replies: 1
    Last Post: March 3rd, 2011, 03:26 PM
  4. [SOLVED] Help with classes & instance methods
    By ShakeyJakey in forum Object Oriented Programming
    Replies: 16
    Last Post: July 30th, 2010, 01:20 PM
  5. [SOLVED] Java program using two classes
    By AZBOY2000 in forum Object Oriented Programming
    Replies: 7
    Last Post: April 21st, 2009, 06:55 AM