Results 1 to 3 of 3
  1. #1
    oladitan's Avatar
    oladitan is offline Member
    Join Date
    Oct 2011
    Posts
    5
    Rep Power
    0

    Default calling a class from main

    Hello. Is it possible to execute a java class from my main class. I have a java class that I want to run when i execute my main class. I want to run the entire class without having to reference each method within the class. Is this possible?

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

    Default Re: calling a class from main

    Quote Originally Posted by oladitan View Post
    Hello. Is it possible to execute a java class from my main class. I have a java class that I want to run when i execute my main class. I want to run the entire class without having to reference each method within the class. Is this possible?
    You don't run a class, you run methods from a class or objects (intantiations) thereof.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    Join Date
    Jan 2010
    Posts
    19
    Rep Power
    0

    Default Re: calling a class from main

    Quote Originally Posted by oladitan View Post
    (...) I want to run the entire class without having to reference each method within the class. Is this possible?
    You could try to use reflection to get all the methods from the class and call dinamically each method. Maybe you will have some trouble to know which parameters pass to each method.

Similar Threads

  1. Calling into the main method
    By vcardell in forum New To Java
    Replies: 4
    Last Post: 11-02-2011, 12:16 AM
  2. Running main method class from another main class
    By tlrocketman in forum New To Java
    Replies: 3
    Last Post: 12-06-2010, 08:30 AM
  3. Calling main method
    By eva in forum New To Java
    Replies: 7
    Last Post: 11-06-2009, 01:37 PM
  4. Calling a variable from main to another class
    By itsme in forum New To Java
    Replies: 1
    Last Post: 12-18-2007, 03:35 PM
  5. calling array from main
    By nalinda in forum New To Java
    Replies: 1
    Last Post: 11-17-2007, 09:41 PM

Tags for this Thread

Posting Permissions

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