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 4 of 4

Thread: Java ArrayList Homework Help

  1. #1
    Junior Member
    Join Date
    Feb 2014
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Java ArrayList Homework Help

    So i'm in ap computer science right now and ArrayList are confusing the **** out of me.

    We're working on a program in which we have to create a method that adds an "ap exam class" to an ArrayList heres what it looks like:

        private ArrayList<APExam> myExams;
     
        myExams = new ArrayList<APExam>();
     
        /**
        * add an exam to myExams
        */
     
        public void addExam(APExam e)
        {
     
        }

    any ideas? Thanks


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: Java ArrayList Homework Help

    The first thing to do is read the API doc for the ArrayList class and see if any of its methods will do what you want.
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,520
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: Java ArrayList Homework Help

    Welcome! Please read this topic to learn how to post code correctly and other useful info for new members.

  4. #4
    Junior Member
    Join Date
    Apr 2013
    Posts
    6
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default Re: Java ArrayList Homework Help

    check the java API for ArrayList there is a method add which adds an object, it should help

Similar Threads

  1. Java Homework Help
    By sonicsoccer in forum What's Wrong With My Code?
    Replies: 9
    Last Post: October 20th, 2013, 11:45 PM
  2. Replies: 8
    Last Post: February 12th, 2013, 05:45 AM
  3. How to use an ArrayList and what is its advantage over array?
    By JavaPF in forum Java SE API Tutorials
    Replies: 4
    Last Post: December 21st, 2011, 04:44 AM
  4. Help for java homework
    By Dark_Shadow in forum Object Oriented Programming
    Replies: 6
    Last Post: December 7th, 2009, 04:08 AM
  5. How to use an ArrayList and what is its advantage over array?
    By JavaPF in forum Java Code Snippets and Tutorials
    Replies: 1
    Last Post: May 17th, 2009, 01:12 PM