View RSS Feed

My Java Tips

Deprecated annotation

Rate this Entry
by , 11-01-2011 at 07:04 PM (641 Views)
You will learn about deprecated annotation in this post.




Deprecated is a standard annotation and itís a marker annotation. We use Deprecated to annotate a method that shouldn't be used anymore. Note: Deprecated should be placed on the same line as the method being deprecated.


Java Code:
package com.domian.a.test;

public class DeprecatedClass {

  @Deprecated public void doSomething() {
    // some code
  }

  public void doSomethingElse() {
    // This method presumably does what doSomething() does, but better
  }
}

Submit "Deprecated annotation" to Facebook Submit "Deprecated annotation" to Digg Submit "Deprecated annotation" to del.icio.us Submit "Deprecated annotation" to StumbleUpon Submit "Deprecated annotation" to Google

Tags: None Add / Edit Tags
Categories
Java SE

Comments