注解与注释

来源:互联网 发布:团委工作总结数据 编辑:程序博客网 时间:2024/05/18 00:39

    /**
    * This is demo
    * @deprecated This variable is for internal use only. It will
    * become package protected in future versions.
    * */ 
  public static final String DEFAULT_CONFIGURATION_FILE = "log4j.properties";

 

@deprecated暗含这个方法是Deprecated,所以加了横线;

 

    /**
    * This is demo
    * @Deprecated This variable is for internal use only. It will
    * become package protected in future versions.
    * */ 
  public static final String DEFAULT_CONFIGURATION_FILE = "log4j.properties";

 

 注意:@Deprecated这个annotation类型和javadoc中的 @deprecated这个tag是有区别的:前者是java编译器识别的,而后者是被javadoc工具所识别用来生成文档(包含程序成员为什么已经过时、它应当如何被禁止或者替代的描述)。

正常的表达习惯是:

 

     /**
     * Returns the day of the month represented by this <tt>Date</tt> object.
     * The value returned is between <code>1</code> and <code>31</code>
     * representing the day of the month that contains or begins with the
     * instant in time represented by this <tt>Date</tt> object, as
     * interpreted in the local time zone.
     *
     * @return  the day of the month represented by this date.
     * @see     java.util.Calendar
     * @deprecated As of JDK version 1.1,
     * replaced by <code>Calendar.get(Calendar.DAY_OF_MONTH)</code>.
     * @deprecated
     */
    @Deprecated
    public int getDate() {
 return normalize().getDayOfMonth();
    }

 

 @Deprecated
 
  public static final String DEFAULT_CONFIGURATION_FILE = "log4j.properties";

 

 //@Deprecated
 
  public static final String DEFAULT_CONFIGURATION_FILE = "log4j.properties";

 

 //@deprecated
 
  public static final String DEFAULT_CONFIGURATION_FILE = "log4j.properties";

  

 

原创粉丝点击