Results 1 to 3 of 3
  1. #1
    Drew is offline Member
    Join Date
    Sep 2009
    Posts
    1
    Rep Power
    0

    Default calliong another program

    i need to take a program i wrote and call upon it in another program. i wrote pacman for a final is my java class and want to call upon it in a new program i am writing just to organize things any idea how i would do so?

  2. #2
    CodesAway's Avatar
    CodesAway is offline Senior Member
    Join Date
    Sep 2009
    Location
    Texas
    Posts
    238
    Rep Power
    6

    Default

    Do you mean you want to call the main method in the Pacman class? If so, call Pacman.main(args). The main method is just like any other method, and can be called the same. Just remember that main is static.

    Also, you may need to import the Class, depending.
    CodesAway - codesaway.info
    writing tools that make writing code a little easier

  3. #3
    Mr.Beans's Avatar
    Mr.Beans is offline Senior Member
    Join Date
    Apr 2009
    Location
    Virginia Beach, Virginia
    Posts
    149
    Rep Power
    0

    Default

    Do you want to link to it during runtime or during compile time.

    Why do you need it?

    I suggest you just import it via

    Java Code:
    import path.to.package;

Similar Threads

  1. Execute A program from a Program!
    By Moncleared in forum Advanced Java
    Replies: 2
    Last Post: 02-22-2009, 05:17 PM
  2. Executing a program within a program
    By gibsonrocker800 in forum New To Java
    Replies: 5
    Last Post: 05-12-2008, 09:24 AM
  3. Replies: 0
    Last Post: 04-04-2008, 03:40 PM
  4. Replies: 0
    Last Post: 10-04-2007, 10:33 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
  •