Java making a method deprecated

Java making a method deprecated

java making a method deprecated

In Java how to declare a method depricated? Is it correct to use

depricated method in my application? But at the same time i want

to show a "warning" message to anyone who is using that method.

Please tell me how to achieve that?

View Answers

December 18, 2012 at 12:23 PM

Declare "@Deprecated" before a method to create a method deprecated in your Java application. Though, it is not a correct

way to use a deprecated class or method in Java. Instead of it

you can use alternatives that exists.

Syntax of declaring a method deprecated.

/**
 * Does some thing in old style.
 *
 * @deprecated use {@link new()} instead.  
 */
@Deprecated
public void old() {
// ...
}









Related Tutorials/Questions & Answers:
Java making a method deprecated
Java making a method deprecated  java making a method deprecated In Java how to declare a method depricated? Is it correct to use depricated...; Declare "@Deprecated" before a method to create a method deprecated in your
What is deprecated?
declaration.   Related Answer: Java making a method deprecated...What is deprecated?  What is mean by deprecated element, method... or element, which is either changed or not approved. In Java if any method or class
Advertisements
making trees - Java Beginners
making trees   pls i do't know what this yerms mean in terms of java trees and stacks? Inorder traverse Switch statement Doing something to the stack thanks in advance
Browser making by java coding
Browser making by java coding  import javax.swing.*; import javax.swing.event.*; import java.awt.*; import java.awt.event.*; import java.net.*; import java.io.*; public class Browser extends JFrame implements
making use java image filters
making use java image filters  while making use any functions built in jerry's filter in java application i get a NullPointerException.. I dont know the reason for this.. please give me a solution
Making efficient program - Java Beginners
Making efficient program  Hi, How you can write efficient programs in Java? Thanks
java method
java method  can we declare a method in java like this static { System.loadLibrary("nativelib"); } i have seen this in a java learning E book. i don't understand the static { } plz help me. what kind of method
Maven dependency for cocoon - cocoon-deprecated version 2.1.9 is released. Learn to use cocoon-deprecated version 2.1.9 in Maven based Java projects
this version ( cocoon - cocoon-deprecated version 2.1.9 ) in their Java project... and includes  cocoon - cocoon-deprecated version 2.1.9 java library in your project...Maven dependency for  cocoon  - Version 2.1.9 of cocoon-deprecated
Maven dependency for cocoon - cocoon-deprecated version 2.1.7 is released. Learn to use cocoon-deprecated version 2.1.7 in Maven based Java projects
this version ( cocoon - cocoon-deprecated version 2.1.7 ) in their Java project... and includes  cocoon - cocoon-deprecated version 2.1.7 java library in your project...Maven dependency for  cocoon  - Version 2.1.7 of cocoon-deprecated
Maven dependency for cocoon - cocoon-deprecated version 2.1.6 is released. Learn to use cocoon-deprecated version 2.1.6 in Maven based Java projects
this version ( cocoon - cocoon-deprecated version 2.1.6 ) in their Java project... and includes  cocoon - cocoon-deprecated version 2.1.6 java library in your project...Maven dependency for  cocoon  - Version 2.1.6 of cocoon-deprecated
Maven dependency for cocoon - cocoon-deprecated version 2.1.4 is released. Learn to use cocoon-deprecated version 2.1.4 in Maven based Java projects
this version ( cocoon - cocoon-deprecated version 2.1.4 ) in their Java project... and includes  cocoon - cocoon-deprecated version 2.1.4 java library in your project...Maven dependency for  cocoon  - Version 2.1.4 of cocoon-deprecated
Maven dependency for cocoon - cocoon-deprecated version 2.1.3 is released. Learn to use cocoon-deprecated version 2.1.3 in Maven based Java projects
this version ( cocoon - cocoon-deprecated version 2.1.3 ) in their Java project... and includes  cocoon - cocoon-deprecated version 2.1.3 java library in your project...Maven dependency for  cocoon  - Version 2.1.3 of cocoon-deprecated
Maven dependency for cocoon - cocoon-deprecated version 2.1.8 is released. Learn to use cocoon-deprecated version 2.1.8 in Maven based Java projects
this version ( cocoon - cocoon-deprecated version 2.1.8 ) in their Java project... and includes  cocoon - cocoon-deprecated version 2.1.8 java library in your project...Maven dependency for  cocoon  - Version 2.1.8 of cocoon-deprecated
Maven dependency for cocoon - cocoon-deprecated version 2.1.5.1 is released. Learn to use cocoon-deprecated version 2.1.5.1 in Maven based Java projects
this version ( cocoon - cocoon-deprecated version 2.1.5.1 ) in their Java... that downloads and includes  cocoon - cocoon-deprecated version 2.1.5.1 java library...Maven dependency for  cocoon  - Version 2.1.5.1 of cocoon-deprecated
Decision-making Statements in java 7
Decision-making Statements in java 7 In this section, we will discuss about Decision-making Statements in java 7. This is one type of control flow statement. Decision-making Statements : This kind of control statements is used where
org.hibernate.dialect.PostgreSQLDialect is deprecated
org.hibernate.dialect.PostgreSQLDialect is deprecated  HI, org.hibernate.dialect.PostgreSQLDialect is deprecated Which dialect to use? Thanks   Hi, You can use any of the following
org.hibernate.dialect.PostgreSQLDialect is deprecated
org.hibernate.dialect.PostgreSQLDialect is deprecated  HI, org.hibernate.dialect.PostgreSQLDialect is deprecated Which dialect to use? Thanks   Hi, You can use any of the following
MPMoviePlayerContentPreloadDidFinishNotification' is deprecated
MPMoviePlayerContentPreloadDidFinishNotification' is deprecated  Hi, While compiling compiler is giving following error: warning: 'MPMoviePlayerContentPreloadDidFinishNotification' is deprecated (declared at /Developer
org.hibernate.dialect.PostgreSQLDialect is deprecated
org.hibernate.dialect.PostgreSQLDialect is deprecated  HI, org.hibernate.dialect.PostgreSQLDialect is deprecated Which dialect to use? Thanks   Hi, You can use any of the following
UIKeyboardBoundsUserInfoKey is deprecated
UIKeyboardBoundsUserInfoKey is deprecated  On running my application i am getting a warning as given below... " UIKeyboardBoundsUserInfoKey is deprecated " What is the cause of it?? and what should i use instead
UILineBreakModeWordWrap is deprecated
UILineBreakModeWordWrap is deprecated  I am getting the error UILineBreakModeWordWrap is deprecated in IOS 6.0. What is the latest code to be used for this? Thanks   Hi, If you use the following code
Exceptional Example in Java
Exceptional Example in Java       When an error occurs in a method, Java creates an object of the Exception method. On making an object of exception method, java send
pass method reference in java
pass method reference in java  How to pass method reference in Java
class method in java
class method in java  How to write a class method in Java?   You must read Java - Class, Object and Methods in Java
Using throw in java method
Using throw in java method  using throw with method implies what
ModuleNotFoundError: No module named 'Deprecated'
ModuleNotFoundError: No module named 'Deprecated'  Hi, My Python... 'Deprecated' How to remove the ModuleNotFoundError: No module named 'Deprecated' error? Thanks   Hi, In your python environment you
try catch method in java
try catch method in java  try catch method in java - when and how should i use the try and catch method in Java ?   Please visit the following links: http://www.roseindia.net/help/java/t/java-try.shtml http
java sleep in main method
java sleep in main method  Hi, How to write Java program for sleeping in the main method? I want Java program to have sleep in main method. Try to share me the code examples. Thanks
java sleep in main method
java sleep in main method  Hi, How to write Java program for sleeping in the main method? I want Java program to have sleep in main method. Try to share me the code examples. Thanks
Generic Method - Java Beginners
Generic Method  I want simple java program for Generic Method with explanation
getch() method in java
getch() method in java  does someone know how can i obtain the getch() function in java
Static Method in Java
Static Method in Java  Is Overriding Static methods possible in java? If Yes, How
java method - Java Beginners
java method  Plz help me on toString() in java  Hi Friend, The Object class provides the method toString() that returns the string..., the toString() method of the object is automatically called. Thanks
Class and method question, Java?
Class and method question, Java?  Consider a Java class that you... Prompt string** and the following method: getValue displays the prompt and reads..., the method should display an error message and ask the user for a new value
software making
software making   hello sir you asked me language... in developing application in it. You should consider Java to develop your software. You can learn java at http://www.roseindia.net Thanks   
Making Exceptions Unchecked - java tutorial,java tutorials
and Unchecked Exceptions in java and how to handle it. The Exception is a condition which indicates error in your code. Types of built-in exception in Java Given below types of built-in exception in java : 1. Unchecked ExceptionADS
Is main method compulsory in Java?
Is main method compulsory in Java?  Hi, Can we have a executable class in Java without a main method? I am going to write simple Java program and there is main method. Is main method compulsory in Java? Thanks   Hi
Method decleration in java
Method decleration in java  What is the catch or declare rule for method declarations
DECESION MAKING STATEMENTS
DECESION MAKING STATEMENTS  The Decision Making statements may be implemented in different forms depending on the complexity of the condition to be tested. Describe various forms of decision making statements in java
java method - Java Beginners
java method  i wanna explation about a method for example... Mail[] getAllMails(String userName) I WANNA EXPLATION ABOUT ABOVE METHOD CAN U... and Tutorials on Java Mail visit to : http://www.roseindia.net/javamail/ Thanks
Finalize method - Java Beginners
method, please can you suggest me a way out.   Hi method, finalize : Every class inherits the finalize() method from java.lang.Object the method... to the object exist the Object finalize method performs no actions but it may
Method overloading in java program
Method overloading in java program  How can we use method overloading in java program?   Method overloading:?In method overloading methods have same name but different type of parameters. Here is an example of method
getch() method in java
getch() method in java  does someone know how can i obtain the getch() function in java?   Hi Friend, In java, you can use the method next() of Scanner class.ADS_TO_REPLACE_1 Here is an example: import java.util.
method overloading - Java Beginners
method overloading   Write a program to demonstrate the method... }  Hi Friend, In Java, the methods having the same name within... is referred to as Method Overloading. In the given example, we have defined
software making
software making   software hello sir sir i have learned this language, c and c++. when we doing coding in c and c++. that time we run those...++. please you give me guidness about making software. sir you tell me its
software making
software making    hello sir , sir you post me answer its difficult to make software in c and c++. but sir i want to make software in c and c++.sir i regueast you please you guid me. i hope you will help me make
method overriding in java
method overriding in java  program to compute area of square,rectangle,triangle,circle and volume of sphere,cylinder and perimeter of a cube using method overriding
method overriding in java
method overriding in java  program to compute area of square,rectangle,triangle,circle and volume of sphere,cylinder and perimeter of a cube using method overriding
making call
making call  Hi, Is it possible to make a call from application with out quitting application in iOS 4?   hello,ADS_TO_REPLACE_1 this the code for call to a number NSString *phoneStr = [[NSString alloc
what is ment by method signature in java.......
what is ment by method signature in java.......  what is ment by method signature in java.......   Hi Friend, The signature of a method is the combination of the method's name along with the number and types

Ads