• Post Reply Bookmark Topic Watch Topic
  • New Topic

About Java5's annotations ?  RSS feed

 
Chen SanHau
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would ask some questions about annotations.

A.




When I compile this code:
javac DeprecatedUser2.java
Message:
Note: DeprecatedUser2.java uses or overrides a deprecated API.
Note: Recompile with -Xlint: deprecation for details.


If I take away the line: "@SuppressWarnings(value={"deprecation"})", I get the same messages as above. What's the function of "@SuppressWarnings" ?
Dose Java 5 implementate "@SuppressWarnings" ?


B. @Inherit

According to the O'Reilly book, Java 5.0 Tiger: A Developer's Notebook
(6.10 Setting Up Inheritance in Annotations), I tried following codes:
-----------------------------------------
file name : InProgress.java

------------------------------
file name : Super.java

------------------------------
file name : Sub.java


------------------------------
When I use "javadoc Sub.java" to genrate HTML help file, I get "Sub.html".
Let me call the first file "Sub.html" as "Subfile1".

When I take away "@Inherited" from InProgress.java, I use "javadoc Sub.java" to genrate HTML help file, I get another "Sub.html".
Let me call the second file "Sub.html" as "Subfile2".

That's the problem, "Subfile1" is the same as "Subfile2".
What's the different of using or not about "@Inherited" ?


Thanks and regards !
[ April 12, 2005: Message edited by: Chen SanHau ]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!