Problem : Class A needs to call Class B with a main function in it. I need to close down class A before Class B runs.
Situation: A has control over a couple of documents I need it to release for B to be able to use. Because of its set up and what I am trying ot do I need to close and launch B. There I do have a batch file for B but I am trying to refrain from using it.
Without more technical descriptions than "close down", "runs", "release" and "launch", we won't be able to help.
Note that any code can run a main() method in another class -- it's just a method, and you can go ahead and call it. If there's something you need to do because calling B.main(), can you just do it explicitly in code in A (closing windows? closing files?)
In other words, "A" is a tangled mess that exits with a lot of open files and depends on the OS to clean up after it? I would consider fixing A, rather than trying to come up with new hacks to pile on top of it. It's good practice for a program to clean up after itself. Rewriting A cleanly would be good experience.
Joined: Jun 20, 2005
I agree with you but this is for a Rapid Release Prototype for a Customer. Functional will be fixed later for right now I need it to just work.