KermMartian wrote:
By the way, a point of forum etiquette that I have been lenient on you for thus far: multi-posting (double-posting, triple-posting, etc) is highly frowned-upon. If you were the last person to post in a topic, and it has been less than a day since your post, you must edit your post to append new things you want to add rather than posting another post. You have both a double-post and a triple-post in this topic; please try to avoid that in the future.
I do apologize. It won't happen again.
Quote:
You would want to set the grade within the Student class, not as a separate element in the ArrayList. Then, you could simply add only the student to the ArrayList, keeping the grades contained within the Student objects.
KermMartian wrote:
As Souvik says, remember, a Student object is a bucket that you can put anything in, just as a Section object is a bucket that you put a Course, an Instructor, and a whole yarn full of Student objects in. Thus far, you've only been dropping a string containing a name into each Student object, but now you also want to put a grade string, so two strings will be sitting inside each Student object.
***OK, I understand that. The problem is that I created 15 student objects in the ArrayList. How do I access the objects in order to add the "grades" attributes? Or should I enter the attributes as I am adding to the ArrayList?*** Disregard this question; I figured it out.
KermMartian wrote:
I suspect you have a fundamental misunderstanding about what an Object is, exactly, and once you get cleared up that an Object is an abstract container that you can pack all kinds of other stuff into, this will start getting much easier for you.
Could you elaborate on this further? If I am misunderstanding the concept of an Object, I need to correct it. What do you believe my understanding of an Object? That might help me to figure it out.
Again, thanks for all of your help!
Edit: I learned from you that I need to instantiate an ArrayList before using it in a constructor. Is it the same for the two single objects that are also in this constructor?