Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Java by (4k points)

I would like to make one of my methods "deprecated" = not used anymore.

But still I would like to have it in my API. I just want to show "warning" to anyone using that method.

How can I achieve that?

1 Answer

0 votes
by (46k points)

Try @Deprecated on the system. Don't neglect about explaining Javadoc field:

/**

* Does some thing in old style.

*

* @deprecated use {@link #new()} instead.

*/

@Deprecated

public void old() {

// ...

}

Related questions

0 votes
1 answer
asked Sep 2, 2019 in Java by Anvi (10.2k points)

Browse Categories

...