Shaun Thomas
Shaun Thomas

Reputation: 31

How to access methods in a class file in Java with a Public Interface?

In Eclipse I have a public interface called RotationCipher, I am given an object file that implements this interface and contains crypto methods without the .java files. How do I access these methods in the class file from my class and use this already compiled code in my program.

I can't seem to find much on Google when I search for this question.

All help will be very much appreciated :)

Upvotes: 1

Views: 406

Answers (1)

Christian H. Kuhn
Christian H. Kuhn

Reputation: 353

In eclipse, you have to add the .class or .jar file to the Project -> Properties -> Java build path. In your class .java file, you have to import the contained class(es). And of course, you have to read the javadoc of the imported class, where you find the provided public methods.

Upvotes: 1

Related Questions