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

Thread: any ways to run a class from another class?

  1. #1
    Member
    Join Date
    Jan 2010
    Posts
    42
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default any ways to run a class from another class?

    Dear JPF-ers,
    As above, any examples will do.

    Regards,
    Zack


  2. #2
    Forum old-timer
    Join Date
    Nov 2008
    Location
    Faversham, Kent, UK
    Posts
    471
    My Mood
    Mellow
    Thanks
    4
    Thanked 58 Times in 54 Posts

    Default Re: any ways to run a class from another class?

    I think you need to explain a bit more clearly what you are trying to achieve.

    The only way Java classes can work together is by calling each other's methods, so in a sense, Java is all about running classes from other classes...

  3. #3
    Member
    Join Date
    Jan 2010
    Posts
    42
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Default Re: any ways to run a class from another class?

    hmmm, found something that may work. reflection

  4. #4
    Forum old-timer
    Join Date
    Nov 2008
    Location
    Faversham, Kent, UK
    Posts
    471
    My Mood
    Mellow
    Thanks
    4
    Thanked 58 Times in 54 Posts

    Default Re: any ways to run a class from another class?

    Quote Originally Posted by javanub:( View Post
    hmmm, found something that may work. reflection
    I recommend you avoid using reflection unless there is no alternative.

    If you can explain clearly what you are trying to do (an example might help), perhaps we can suggest a solution.

Similar Threads

  1. 500 Ways to Print 1 to 10
    By Freaky Chris in forum The Cafe
    Replies: 132
    Last Post: August 1st, 2014, 06:47 AM
  2. Replies: 0
    Last Post: April 11th, 2010, 08:56 AM
  3. problem with data access when a class call another class
    By ea09530 in forum What's Wrong With My Code?
    Replies: 1
    Last Post: April 4th, 2010, 05:20 PM
  4. Accessing a method of one class in another class
    By Sai in forum What's Wrong With My Code?
    Replies: 6
    Last Post: March 23rd, 2010, 04:06 PM
  5. how to load a class and type cast to that class?
    By chinni in forum Object Oriented Programming
    Replies: 2
    Last Post: November 9th, 2009, 09:18 AM