File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes what is depreciation of methods Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "what is depreciation of methods" Watch "what is depreciation of methods" New topic
Author

what is depreciation of methods

kaustubh ram
Greenhorn

Joined: Feb 06, 2001
Posts: 5
i used getHour() method in jdk1.3.the method is working properly
but a message is given that this is depreciated.
if a method is depreciated but is working fine then what has
changed with that method?
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
Usually, it means that nothing has changed within the method itself, but an already-existing problem was discovered. They don't want to invalidate old code by changing the method drastically, but they want to encourage people to use a different solution. In your case, I assume you mean the getHours() method in either java.util.Date or java.sql.Date. If you look in the API you will see an explanatory message indicating what is wrong with the method. For java.util.Date.getHours() you should really use a Calendar instance instead; for java.sql.Date you probably should use a Time object instead since a Date will always have hours = 0.


"I'm not back." - Bill Harding, Twister
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040

Deprecated methods don't mean that something has changes.
Nothig is changed. It only means that, if future this method
will be withdrawn from the API. If you goto the API (I don't
have the link right now for 1.3) and lookup for this method,
a work-around, with new methods, is generally available and
it is highly suggested that you replace your deprecated method
with the suggested work-around.
regds.
- satya

Take a Minute, Donate an Hour, Change a Life
http://www.ashanet.org/workanhour/2006/?r=Javaranch_ML&a=81
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040
Holy smokes....Jim I din't know you were in the forum...
thanks.
- satya
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
I try to wander around occasionally.
 
jQuery in Action, 2nd edition
 
subject: what is depreciation of methods