Solved

What is deprection in java ?

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

734 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