Results 1 to 5 of 5

Thread: Array List help

  1. #1
    Weejee37 is offline Member
    Join Date
    Oct 2009
    Posts
    2
    Rep Power
    0

    Default Array List help

    So I am doing a lab for university and unfortunately the prof is really terrible.

    I need to make a project, using BlueJ, where I have to use an Array List to populate some classes.

    the classes are; BirdSpecies, Person, Sighting, BirdList and Repository.

    BirdSpecies has 3 methods, birdName, birdAbbreviation and birdScientificName
    Person has 3 methods, personFirstName, personLastName, and personBirdSaw
    these 2 classes have the simple getters, setters, constructors and toString.

    basically, thats all he has given us and expects us to just figure out what array lists are and make it so that everything can be populated through the Repository class. (or something to that extent)

    Any help? Where do i start?

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Given your instructions, you should be able to make class skeletons, i.e.,

    Java Code:
    public class MyClass {
      private String something;
    
      public MyClass()
    
      public String getSomething() {
        return something;
      }
    
      public void setSomething(String something) {
        this.something = something;
      }
    }
    Then start fleshing out your getters and setters. Come on back if you run into a specific road block. Good luck!

  3. #3
    yellowfire7 is offline Member
    Join Date
    Oct 2009
    Posts
    3
    Rep Power
    0

    Default

    I would guess that the Bird class is the simplest, so you should make that first, then the Sightings, then the Person, which probably has a list of sightings so you can know from the Person class what birds were seen. The repository class then probably has two ArrayLists, of Person and Bird, where you can then start entering info.

    edit: wow I'm slow.

  4. #4
    Weejee37 is offline Member
    Join Date
    Oct 2009
    Posts
    2
    Rep Power
    0

    Default

    Thanks for the help, but i think im going to need ALOT more help than i should on this. Going to need someone basically walk me right through this with me from start to finish.

  5. #5
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default

    Quote Originally Posted by Weejee37 View Post
    Thanks for the help, but i think im going to need ALOT more help than i should on this. Going to need someone basically walk me right through this with me from start to finish.
    Then you should talk to your teacher. There are limits on what volunteers can or should do on a forum such as this one.

    My recommendation remains the same: try to do as much as you can on your own, and then come on back with specific questions over your code.

    Much luck.

Similar Threads

  1. Array List
    By mashyum in forum Advanced Java
    Replies: 2
    Last Post: 07-28-2009, 07:47 AM
  2. linked list or array?
    By sick_peng in forum New To Java
    Replies: 6
    Last Post: 04-15-2009, 08:33 PM
  3. Array List
    By mprentice84 in forum New To Java
    Replies: 2
    Last Post: 02-20-2009, 03:12 AM
  4. array list help
    By dorno83 in forum New To Java
    Replies: 9
    Last Post: 11-07-2008, 10:56 AM
  5. using an Array list
    By toad in forum New To Java
    Replies: 1
    Last Post: 11-18-2007, 10:08 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •