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.

How do get and set methods work??

Hi all! I am extremely new to java and to computer programming in general so I greatly appreciate all our help. Here's my problem, I am trying to write a program that reads in a basic text file with some names and some numbers, and inputs the given information into an array list. Each line of the text file is supposed to serve as a separate object in the array list. The major problem for me is that I am required to use 2 classes to do this. One class must be the main class and the other class is supposed to hold Get and Set methods for each piece of information in each object in the ArrayList, and I am very clueless as to how to use get and set methods. Here is the code that I have so far....i know the Driver class is where the get and set methods are supposed to go...i just dont know what they are supposed to look like or how to do them. Please help me if you can maybe just an example or anything you can do to help I just need some help I've tried everything I know, I am very desperate! Thank you so much in advance.