Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what is depreciation of methods

 
kaustubh ram
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
 
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Holy smokes....Jim I din't know you were in the forum...
thanks.
- satya
 
Jim Yingst
Wanderer
Sheriff
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I try to wander around occasionally.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic