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.


>> REGISTER NOW TO START POSTING


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

Results 1 to 2 of 2

Thread: How to use Get and Set methods

  1. #1
    Junior Member
    Join Date
    Mar 2012
    Location
    Dar es Salaam
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post How to use Get and Set methods

    Hi, am very new to java programming and our tutor taught us on how to hide information in methods, one of the ways is using get and set methods. I don understand how exactly these methods works and when should we use them. Need your help guyz. thanx


  2. #2
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,318
    Thanks
    181
    Thanked 833 Times in 772 Posts
    Blog Entries
    5

    Default Re: How to use Get and Set methods

    These methods are used just as their definitions describe - to get and set the value of a variable. This is typical when the scope of the variable is hidden, for instance through access modifiers using encapsulation. If you don't know what the words are in bold, I highly recommend doing an internet search for them.

Similar Threads

  1. Help with methods?
    By THeAnnonymous in forum What's Wrong With My Code?
    Replies: 1
    Last Post: December 11th, 2011, 09:27 AM
  2. I need help with my methods please?
    By THeAnnonymous in forum What's Wrong With My Code?
    Replies: 1
    Last Post: December 11th, 2011, 09:22 AM
  3. Help with methods
    By CSUTD in forum What's Wrong With My Code?
    Replies: 4
    Last Post: October 8th, 2011, 10:39 PM
  4. methods help
    By hockey87 in forum AWT / Java Swing
    Replies: 1
    Last Post: March 9th, 2010, 11:57 PM
  5. Re-using methods?
    By Morevan in forum What's Wrong With My Code?
    Replies: 2
    Last Post: January 26th, 2010, 05:04 PM