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: Noobie Object/Class Linking help

  1. #1
    Junior Member
    Join Date
    Jan 2013
    Posts
    3
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Noobie Object/Class Linking help

    he concepts at the moment.


  2. #2
    Junior Member
    Join Date
    Jun 2012
    Posts
    4
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default Re: Noobie Object/Class Linking help

    Looks like you have made a good start - you have managed to get the capitalization of attributes, methods and Class names correct from the sart - an encouraging sign!

    I would only quibble with a couple of issues - Class attributes 'should' have the appropriate qualifier 'public', 'private' etc. and you need to use getters and setters to access those attributes e.g.:
    public String getName(){ return name;}

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

    Bonerize (January 31st, 2013)

  4. #3
    Junior Member
    Join Date
    Jan 2013
    Posts
    3
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Re: Noobie Object/Class Linking help

    So lets say I initialize the Athlete class in a main test program. I would declare the name and country of the diver. But then how do I link the dive class to the Athlete class so that I am able to initialize the type of dive and dive difficulty to associate that with the Athlete I initialized?

  5. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    18,552
    Thanks
    45
    Thanked 1,953 Times in 1,927 Posts

    Default Re: Noobie Object/Class Linking help

    If you have a reference to an instance of the class, you can call its methods to set values in the instance.
    If you don't understand my answer, don't ignore it, ask a question.

  6. The Following User Says Thank You to Norm For This Useful Post:

    Bonerize (January 31st, 2013)

  7. #5
    Junior Member
    Join Date
    Jan 2013
    Posts
    3
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default Re: Noobie Object/Class Linking help

    Admin can close thread. I found a solution. Thanks!

Similar Threads

  1. Can't create inner class object outside the outer class help needed?
    By Dark knight in forum Java Theory & Questions
    Replies: 2
    Last Post: July 31st, 2012, 02:34 AM
  2. Convert File Object to class<?> object
    By CEO in forum File I/O & Other I/O Streams
    Replies: 3
    Last Post: June 27th, 2012, 06:55 PM
  3. Linking class's
    By Tate in forum Object Oriented Programming
    Replies: 3
    Last Post: February 23rd, 2012, 03:12 AM
  4. Calling from one javabean object to other javabean object in a single class
    By kichkich in forum What's Wrong With My Code?
    Replies: 2
    Last Post: June 24th, 2011, 07:20 AM
  5. Object as a Reference into Object's Class
    By Ace Coder in forum Object Oriented Programming
    Replies: 6
    Last Post: November 30th, 2010, 11:22 AM