• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to Know Interface methods?(Very Imp.)

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 !!
 
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
'bipin_maji'
PROPER NAMES ARE NOW REQUIRED!!
Read this post for more details.
Ajith
 
Enthuware Software Support
Posts: 4810
52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
reply
    Bookmark Topic Watch Topic
  • New Topic