File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes calling two classes in the same program Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "calling two classes in the same program" Watch "calling two classes in the same program" New topic

calling two classes in the same program

Chris Fetterley
Ranch Hand

Joined: May 13, 2003
Posts: 51
I am trying to created a file i/o program that will ftp the information when the window closes. The information has to go to a different server hence why I want to do an ftp and not have the file placed somewhere on the network. The question is then does anyone have an idea as how to call the ftp class within the same program?
(2 main classes, one program)
Layne Lund
Ranch Hand

Joined: Dec 06, 2001
Posts: 3061
Perhaps I don't understand exactly what you are asking, but you should be able to do something like this:

Of course, these may not be the exact methods you need. I'm also assuming that you wrote the FTP class, but if the API already has one, you should use that instead. Check out the API docs to find what functionality it provides this way.
Also, it will help a lot if you can be more specific. You should post a small amount of code to illustrate what you are doing. This gives your question some context and we can work with it from there.

Java API Documentation
The Java Tutorial
Joel McNary

Joined: Aug 20, 2001
Posts: 1824

Once a JVM is running, a main method is just like any other method. You just have to prepare the parameters (if any) and call the method.

Piscis Babelis est parvus, flavus, et hiridicus, et est probabiliter insolitissima raritas in toto mundo.
I agree. Here's the link:
subject: calling two classes in the same program
It's not a secret anymore!