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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "deprecated API" Watch "deprecated API" New topic
Author

deprecated API

Trupti brane
Greenhorn

Joined: Aug 16, 2011
Posts: 20

after compiling my program i am getting

Note: invest.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.

after recompiling it with -deprecation flag
i am getting following warning :
readLine() in java.io.DataInputStream has been deprected




following is my code :
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 9990
    
    7

Trupti brane wrote:
after recompiling it with -deprecation flag
i am getting following warning :
readLine() in java.io.DataInputStream has been deprected

The API docs are your friend. Check them out to understand why this method is deprecated and a suggested workaround.


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Trupti brane
Greenhorn

Joined: Aug 16, 2011
Posts: 20

got the answer

readLine()
Deprecated. This method does not properly convert bytes to characters. As of JDK 1.1, the preferred way to read lines of text is via the BufferedReader.readLine() method. Programs that use the DataInputStream class to read lines can be converted to use the BufferedReader class by replacing code of the form:

DataInputStream d = new DataInputStream(in);


with:

BufferedReader d
= new BufferedReader(new InputStreamReader(in));
Trupti brane
Greenhorn

Joined: Aug 16, 2011
Posts: 20

new code with changes

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: deprecated API
 
Similar Threads
Plz help i am a newbie
Format the output
reading data from keyboard
Console I/O
hi