Solved

What is deprection in java ?

Posted on 2003-11-07
5
209 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
  • 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Suggested Solutions

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:

757 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now