Results 1 to 2 of 2

Thread: advanced array

  1. #1
    joedirt819 is offline Member
    Join Date
    Sep 2013
    Posts
    1
    Rep Power
    0

    Default advanced array

    i need to set up an array for a skatepark. so i would set it up as a blank array skatepark and i would set up a read in a do/while loop for a user to enter the data, until all of the skateparks where in then i would sort them alphbetically. i could do that all easily but the problem that gets me is for each skatepark there needs to be the county its located in and also 2-5 things there( rail, halfpipe, quartpipe, box, etc....) so for each skatepark in the array i would need those qualifications to go along with said skatepark. this is where i am confused because i read aimless info into an array but i dont know how i would get a skatepark to hold onto the location and objects in them, when i would have multiple skateparks in my array also

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,345
    Blog Entries
    7
    Rep Power
    20

    Default Re: advanced array

    Quote Originally Posted by joedirt819 View Post
    i need to set up an array for a skatepark. so i would set it up as a blank array skatepark and i would set up a read in a do/while loop for a user to enter the data, until all of the skateparks where in then i would sort them alphbetically. i could do that all easily but the problem that gets me is for each skatepark there needs to be the county its located in and also 2-5 things there( rail, halfpipe, quartpipe, box, etc....) so for each skatepark in the array i would need those qualifications to go along with said skatepark. this is where i am confused because i read aimless info into an array but i dont know how i would get a skatepark to hold onto the location and objects in them, when i would have multiple skateparks in my array also
    It's time for another little class: SkatePark; it holds all the information you described and you'd simply have an array of type SkatePark[] (or even better, have a List<SkatePark>). You have some stydying to do.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

Similar Threads

  1. More advanced interfaces.
    By MR bruto in forum New To Java
    Replies: 2
    Last Post: 08-03-2013, 05:56 PM
  2. Maybe an Advanced Question
    By NotTooOld in forum New To Java
    Replies: 5
    Last Post: 05-10-2013, 05:18 PM
  3. Options...Might be advanced rather than new xD
    By spiil778 in forum New To Java
    Replies: 3
    Last Post: 02-20-2013, 08:30 PM
  4. Advanced design
    By dominapector in forum AWT / Swing
    Replies: 3
    Last Post: 11-24-2011, 01:26 AM
  5. Advanced Looping
    By nuggetman4 in forum New To Java
    Replies: 1
    Last Post: 05-10-2010, 06:54 AM

Posting Permissions

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