Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using Someone Else's Class(es)

 
Karen Baog
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,

If someone provides me a .class how can I use it together with my other class(es) to run it?

What do I need to know about this other .class so I can use it?
How do I use it if this .class has public methods (don't care about the implementation, just wants to use it).

Cheers!
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34410
346
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Karen,
The person who gave you the .class file typically tells you the name of the class and the public methods in it. This could be in the form of JavaDoc or even a list.
 
Patrick Mallahan
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can also just look at the code and figure it out yourself. but mainly all you do is import it into the other code that you want to use it in.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic