Solved

What is deprection in java ?

Posted on 2003-11-07
5
219 Views
Last Modified: 2008-03-03

I have this error.

The method getYear invoked for type java.util.Date with arguments ()
is deprecated.

What exactly does this mean ??


How would I resolve this ?

0
Comment
Question by:pheats
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 86

Expert Comment

by:CEHJ
ID: 9700188
It means that thse methods are on the way out and Sun wants to tell you so. You should use a Calendar to do this.
0
 
LVL 86

Accepted Solution

by:
CEHJ earned 30 total points
ID: 9700197
Calendar cal = Calendar.getInstance();
cal.setTime(yourDate);
int year = cal.get(Calendar.YEAR);
0
 
LVL 5

Expert Comment

by:arjanh
ID: 9700209
Deprecated means that you preferably shouldn't use it in new programs. It is not really an error, just a warning.
Calendar.get(Calendar.YEAR) - 1900
0
 
LVL 15

Expert Comment

by:jimmack
ID: 9700250
>>  It means that thse methods are on the way out

CEHJ is right.  However, I don't know of any deprecated items that have actually been removed yet?

Does anybody know of any?

(Just for interest ;-))
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 9700530
I don't know of any personally ;-)
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses

740 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question