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

Thread: Ryder Cup 2014 Application

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

    Default Ryder Cup 2014 Application

    Hi there,

    I am relatively new to Java Programming and have an assignment in college to write an application based around the Ryder Cup 2014...

    A part I am struggling with is the section referring to the course itself.

    I have information on all holes and want to store them in an array to be called on when the user wishes.
    eg Hole 1
    Par 4 450 yards
    tee shot :........
    Hazards yes/no

    Is it possible to assign a value of a little paragraph like this to members of an array??


    Any help greatly appreciated

    Thanks Stephen.


  2. #2
    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: Ryder Cup 2014 Application

    Welcome to the forum! Please read this topic to learn how to post code in code or highlight tags and other useful info for new members.

    If the element of the array is an object of a class that has those attributes, like an instance of RyderCupHole. E.g.:

    RyderCupHole[] golfHoles = new RyderCupHole[36];

    Where the class RyderCupHole includes instance variables for each of those attributes you listed.

  3. The Following User Says Thank You to GregBrannon For This Useful Post:

    StephenFanning (March 8th, 2014)

  4. #3
    Junior Member
    Join Date
    Mar 2014
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: Ryder Cup 2014 Application

    Hi Greg thanks for the quick reply,

    That makes sense alright, the thing is that the information is a mixture of ints and Strings, Im currently looking at ArrayLists am I thinking in the right direction even?

  5. #4
    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: Ryder Cup 2014 Application

    The mixture of data types does not matter as long as they're properly defined as attributes/fields/instance variables of the class.

    An ArrayList would also be an excellent tool for containing the objects. We can't know what you're allowed or able to use until you tell us.

  6. #5
    Junior Member
    Join Date
    Mar 2014
    Posts
    3
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Re: Ryder Cup 2014 Application

    ok, Im gonna try a few things out and see how I get on. Will post some code when I make some progress.

    Thanks.

Similar Threads

  1. Replies: 1
    Last Post: August 23rd, 2013, 06:33 AM
  2. how to run any installed application through my java application??
    By sgsamanthjain in forum Java Theory & Questions
    Replies: 1
    Last Post: April 1st, 2011, 08:17 AM
  3. Replies: 0
    Last Post: December 3rd, 2009, 04:43 PM

Tags for this Thread