Meaningless Drivel is fun!*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes How to Know Interface methods?(Very Imp.) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "How to Know Interface methods?(Very Imp.)" Watch "How to Know Interface methods?(Very Imp.)" New topic
Author

How to Know Interface methods?(Very Imp.)

bipin_maji
Greenhorn

Joined: Oct 19, 2000
Posts: 1
I have Created my Interface and given four methods inside the Interface.I compiled my Interface and given the compiled interface file to my Friend.
How do my friend know that what are the methods inside the Interface, so that he can implement the Interface in his class?
Udayan Naik
Ranch Hand

Joined: Oct 18, 2000
Posts: 135
Well , it depends on the interface designer himself.
1)The first way is to provide some sort of documentation to the person who wants to implement that interface.The best way is to use the javadoc tool available from Sun.
2)The second way would be to implement the interface and compile the class.From the errors the compiler throws , which could be of the form "class XYZ shoulde be ddeclared abstract because it does not implement method ABC()..." your friend will come to know abot the methods u have provided in that interface.
Any other suggestions are welcome.
------------------
Come on in !! Drinks are on the house in the Big Moose Saloon !!


Udayan Naik<BR>Sun Certified Programmer for the Java 2 Platform
Ajith Kallambella
Sheriff

Joined: Mar 17, 2000
Posts: 5782
'bipin_maji'
PROPER NAMES ARE NOW REQUIRED!!
Read this post for more details.
Ajith

Open Group Certified Distinguished IT Architect. Open Group Certified Master IT Architect. Sun Certified Architect (SCEA).
Paul Anilprem
Enthuware Software Support
Ranch Hand

Joined: Sep 23, 2000
Posts: 3253
    
    2
It is the responsibility of the interface developer to publish it! What good an interface is, if the publisher doesn't tell what it is for?
Also note that, publishing an interface doesn't mean just telling the method names and parameters. You also have to tell the semantics, use and pretty much everything that helps a user to implement that interface 'resposibly'.
Best example is JDBC, all the classes are actually interfaces. They come with complete documentation of what they do. Vendors who implement those interfaces must stick to the interfaces' meaning/use.

Of course, you can run javap on the class file and find all the methods/fields.
HTH,
Paul.

------------------
Get Certified, Guaranteed!
(Now Revised for the new Pattern)
www.enthuware.com/jqplus


Enthuware - Best Mock Exams and Questions for Oracle/Sun Java Certifications
Quality Guaranteed - Pass or Full Refund!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to Know Interface methods?(Very Imp.)
 
Similar Threads
Marker Interface???
Entity Home with Business Methods
How do I access my dataaccess class from JSP?
Marker Interface???
protecting .class file from decompilation