que esta mal?23 de Octubre del 2005
Preguntasoy neofito y tengo el sig codigo
import java.io.*;
public class opera
{
public static void main(String arg[])
{
int x,y;
System.out.println(\\\"x= \\\");
x=System.in.read ();
System.out.println(\\\"y= \\\");
y=System.in.read ();
System.out.println(\\\"Suma=\\\"+x+y);
}
}
pero me marca este error:
D:\\\\practicasjava>javac opera.java
opera.java:10: unreported exception java.io.IOException; must be caught or decla
red to be thrown
x=System.in.read ();
^
opera.java:12: unreported exception java.io.IOException; must be caught or decla
red to be thrown
y=System.in.read ();
^
2 errors
import java.io.*;
public class opera
{
public static void main(String arg[])
{
int x,y;
System.out.println(\\\"x= \\\");
x=System.in.read ();
System.out.println(\\\"y= \\\");
y=System.in.read ();
System.out.println(\\\"Suma=\\\"+x+y);
}
}
pero me marca este error:
D:\\\\practicasjava>javac opera.java
opera.java:10: unreported exception java.io.IOException; must be caught or decla
red to be thrown
x=System.in.read ();
^
opera.java:12: unreported exception java.io.IOException; must be caught or decla
red to be thrown
y=System.in.read ();
^
2 errors
