Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How do I deprecate an interface?

 
Andres Gonzalez
Ranch Hand
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes, use the @deprecate tag in javadoc. But I have a situation like this:
I have an interface A. I have deprecated all its methods (my requirement is to deprecate all its methods).
I have an interface B that extends A. Interface B does *not* declare any methods. So, is this interface automatically deprecated? Can u use the @deprecated tag on the interface declaration as well as every method? I other words, is the @deprecated tag meant to be use on method basis or by interface declaration as well?

[ December 04, 2003: Message edited by: Andres Gonzalez ]
 
Andres Gonzalez
Ranch Hand
Posts: 1561
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To answer my question:
...One technique you might consider is to deprecate classes and methods you are not satisfied with. A deprecated class is a class that is no longer supported. When you deprecate a class, you are notifying classes that use the class that your intention is to remove the class at some point. Most IDEs and Java compilers will recognize that a class is deprecated and send a warning message. You deprecate a class or method by adding an @deprecated tag. You should add a comment after the @deprecated tag that explains why the class or method was deprecated and how the replacement works.

http://www.midrangeserver.com/mgo/mgo060403-story01.html
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic