Simple programming Error in Java

Status
Not open for further replies.

nitish_mythology

OSS Enthusiast!
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);
}
}
 

icecoolz

Cyborg Agent
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.
 
Status
Not open for further replies.
Top Bottom