DIGIT-ARC read-only archive · snapshot: July 23, 2026

Simple programming Error in Java

3 posts · originally from https://geek.digit.in/community/threads/simple-programming-error-in-java.16934/

nitish_mythology
nitish_mythology Original post #1
Oct 14, 2005 at 2:14 PM
I copied a simple program from a book. Author is E.Balaguruswami
It was just to show basic input using package io and Datainputstream.
After compilation an error was shown--
Note: filename.java uses or overrides a depricated API
Note:Recompile with-Xlint:deprication for detail

Full code is===
import java.io.*;
class sania
{
public static void main(String args[])
{
DataInputStream i=new DataInputStream(System.in);
int c=0;
try
{
System.out.println("Enter a Number");
c=Integer.parseInt(i.readLine());
}
catch(Exception e) { }
System.out.print(+c);
}
}
I
Oct 14, 2005 at 6:30 PM
thats is not an error. Its just a warning meaning that you are using an Outdated API which may not be supported in coming versions. Your compilation was fine. Run the program and it will work.
aadipa
aadipa #3
Oct 15, 2005 at 12:01 AM
It is just warnning. Which version of Java SDK are you using?