salasadi
asked on
cannot get rid of the message Java Deprecated Class
I have simple class to read from text file. the clas work ok, but the "deprecation" warrning is bugging me :(
C:\>javac FileInput.java -Xlint
FileInput.java:29: warning: [deprecation] readLine() in java.io.DataInputStream
has been deprecated
System.out.println(dis.rea dLine());
^
1 warning
C:\>javac FileInput.java
Note: FileInput.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
here is the class:
import java.io.File;
import java.io.FileNotFoundExcept ion;
import java.io.IOException;
public class FileInput {
public static void main(String[] args) {
File file = new File("C:\\que.sql");
try {
fis = new File(file);
BufferedReader in = new BufferedReader(new InputStreamReader(fis));
while (in.available() != 0) {
System.out.println(in.read Line());
}
fis.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
}
C:\>javac FileInput.java -Xlint
FileInput.java:29: warning: [deprecation] readLine() in java.io.DataInputStream
has been deprecated
System.out.println(dis.rea
^
1 warning
C:\>javac FileInput.java
Note: FileInput.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
here is the class:
import java.io.File;
import java.io.FileNotFoundExcept
import java.io.IOException;
public class FileInput {
public static void main(String[] args) {
File file = new File("C:\\que.sql");
try {
fis = new File(file);
BufferedReader in = new BufferedReader(new InputStreamReader(fis));
while (in.available() != 0) {
System.out.println(in.read
}
fis.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.