• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

java uses or overrides a deprecated API.

 
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator



When i try to compile above program i get following error
Note: D:\myjava\K.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
please help me

 
Bartender
Posts: 11497
19
Android Google Web Toolkit Mac Eclipse IDE Ubuntu Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Recompile with -Xlint:deprecation for details


So did you try recompiling with the flag as suggested?

Deprecated methods are methods whose usage is not recommended anymore. The API will give you an alternative.
 
Ranch Hand
Posts: 51
Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The following method in java.io.DataInputStream has been deprecated because it does not properly convert bytes to characters.

Deprecated Method Alternative
String readLine() String BufferedReader.readLine()

For more info: Deprecated IO
 
Rancher
Posts: 43081
77
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you just intend to read text, then neither BufferedInputStream nor DataInputStream is appropriate. Use InputStreamReader and BufferedReader instead.

As an aside, I estimate that in 90% of the cases where I've seen people use DataInputStream, it is the wrong tool for the job.
 
mooooooo ..... tiny ad ....
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic