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

Thread: Running methods of a class that created you...

  1. #1
    Junior Member
    Join Date
    Apr 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile Running methods of a class that created you...

    Hello, I'm new here!

    I was wondering, is it possible for an object to run a method of the object that created it?

    As in, if 'ObjectA' creates an object 'ObjectB' (of a different class), can ObjectB run methods of ObjectA? Is it simple to do?

    Many Thanks,

    Joe


  2. #2
    Super Moderator helloworld922's Avatar
    Join Date
    Jun 2009
    Posts
    2,896
    Thanks
    23
    Thanked 619 Times in 561 Posts
    Blog Entries
    18

    Default Re: Running methods of a class that created you...

    Yes, but you must pass ObjectA to ObjectB as a parameter.

  3. #3
    Junior Member
    Join Date
    Apr 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Running methods of a class that created you...

    Ahhh! Thanks!!

Similar Threads

  1. Replies: 2
    Last Post: February 28th, 2011, 09:51 AM
  2. Help requested - testing a class with a tester class, no methods allowed.
    By miketeezie in forum What's Wrong With My Code?
    Replies: 3
    Last Post: February 21st, 2011, 09:40 PM
  3. Help with running class file
    By carface in forum What's Wrong With My Code?
    Replies: 3
    Last Post: December 30th, 2010, 04:40 PM
  4. [SOLVED] Help with Class Methods(Probably simple)
    By ShakeyJakey in forum Object Oriented Programming
    Replies: 9
    Last Post: May 27th, 2010, 09:53 AM
  5. running a class from another projects, reflection
    By led1433 in forum Object Oriented Programming
    Replies: 7
    Last Post: July 29th, 2009, 01:47 PM

Tags for this Thread