Sponsored By

Sign in to follow this  
iccaros

Java Classes

Recommended Posts

ok

we are creating a server from exsistiong code. I have the source or .java files and I also have .class files..

I need to use these methods in my program but I don't know how to add the methods.. they are part of package, but I also have the source file (.java) for each of these.. do I just put the source files in my same directory and what use import? or do I just call the class

example Server SImServer = null;

Share this post


Link to post
Share on other sites

The .classes should be in a directory hierarchy the follows the package hierarchy (e.g. package foo.bar in foo/bar/). Add the root of the directory hierarchy to your classpath and import the classes as you normally would (e.g. import foo.bar.*). You don't need the source files unless you're modifying the code.

Edited by jcl

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this