Deprecated Java Platform Classes
Okay, I'm a newbie to Java and I'm working through the libraries. So when I want to do something, I search through the java docs to find what I need. The trouble is that, in a good number of cases, all the stuff I find is deprecated! (BTW, is there anything that's not deprecated?!?) My question is, is there a way to find out what's replacing the deprecated classes & methods?
The latest version of the JavaDocs will tell you what you should use instead.
The javadoc is usually very clear on what replaces the deprecated code.
No. All the Java classes are deprecated.
name withheld out of cowardice
Can you give an example of what's deprecated? In my day to day use, I find very little is.
I agree. I used Java full-time for about 3 years, and this is a major annoyance. You run into deprecated classes and methods regularly and usually they don't say what to use instead. Sometimes they deprecate and even remove it without adding any replacement, so you're SOL. (Write your own, from scratch...)
For instance, some Thread methods are deprecated. In those cases, there's some good documentation as to why they were deprecated, so try to read that.
The last thing was acouple of weeks ago... I found some code on the web that had some method tp simply call and have it serialize a resultSet to XML. It's gone now, and I can't figure out what to use in its place. (I'm sorry, I don't remember the exact names of the classes & methods.)
> No. All the Java classes are deprecated.
The Masked Programmer
Hmm, "deprecation" seems different from a disappearing lib which you found on the net. Deprecation is only a label that the powers-that-be would like to get rid of something.
Tayssir John Gabbour
There are many deprecated classes that are still fully functional but Sun would like you to move to the new ones. My biggest gripe on this is the Date classes. Date is deprecated and they want you to go through the Calendar interface now. But Date still works and is a lot simpler. In practical terms I don't know whether they'd turn it off since Date is embedded in so many apps.
If "Deprecation" annoys you turn it off at the command line. I find the new Calendar classes a lot more usefull than the old ones. Infact I have a whole lot of guys working in different modules telling me I want your function to give me date in this format and and that format. I use SimpleDateformat class and keep everyone happy. Everyone gets what they want.
I think you'll find there's quite a few java developers on this forum.
"... to my knowledge, Sun have never actually removed a deprecated method."
Fog Creek Home