• 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
  • Devaka Cooray
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Martijn Verburg
  • Frits Walraven
  • Himai Minh

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: 43028
76
  • 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.
 
What I don't understand is how they changed the earth's orbit to fit the metric calendar. Tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic