Results 1 to 4 of 4
Thread: note while compiling
- 09-03-2008, 12:35 PM #1
note while compiling
y im getting this note wen i compile the program
F:\javademo\string input>javac stringip.java
Note: stringip.java uses or overrides a deprecated API.
Note: Recompile with -deprecation for details.
but executing correctly,,,,,,,,
code present in stringip.java is
import java.io.*;
class stringip{
public static void main(String ar[]){
try{
DataInputStream ds=new DataInputStream(System.in);
String a=ds.readLine();
int d=Integer.parseInt(ds.readLine());
System.out.println(a+d);
}
catch(Exception e)
{
System.out.println(e);
}
}
}
- 09-03-2008, 03:45 PM #2
getting this noteHave you compiled with that option? If not you need to do so.Recompile with -deprecation for details.
You are using an old method that author of the class wants to get rid of.
- 09-03-2008, 04:07 PM #3
Senior Member
- Join Date
- Aug 2008
- Posts
- 384
- Rep Power
- 5
This means that the method can be removed from the java pack at any time, which will stop your program from working...You are using an old method that author of the class wants to get rid of.I die a little on the inside...
Every time I get shot.
- 09-03-2008, 11:52 PM #4
This is how you handle compiler deprecation warnings:
Look up the readLine method in the DataInputStream class to see what its use has been replaced with.Java Code:C:\jexp>javac stringip.java Note: stringip.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. C:\jexp>javac -Xlint:deprecation stringip.java stringip.java:7: warning: [deprecation] readLine() in java.io.DataInputStream has been deprecated String a=ds.readLine(); ^ stringip.java:8: warning: [deprecation] readLine() in java.io.DataInputStream has been deprecated int d=Integer.parseInt(ds.readLine()); ^ 2 warnings C:\jexp>
Similar Threads
-
compiling trouble
By capacitator in forum CLDC and MIDPReplies: 4Last Post: 06-10-2008, 10:12 PM -
I have 3 errors after compiling
By coco in forum JDBCReplies: 2Last Post: 10-18-2007, 09:32 AM -
Error during compiling
By boy22 in forum New To JavaReplies: 2Last Post: 08-03-2007, 02:42 AM -
problems when compiling
By valery in forum New To JavaReplies: 2Last Post: 07-25-2007, 07:35 PM -
Error while compiling
By ai_2007 in forum Advanced JavaReplies: 1Last Post: 07-01-2007, 11:37 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks