Ver Mensaje Individual
  #1 (permalink)  
Antiguo 15/12/2012, 12:42
Avatar de iivo94
iivo94
 
Fecha de Ingreso: febrero-2011
Ubicación: Argentina
Mensajes: 281
Antigüedad: 13 años, 2 meses
Puntos: 3
try catch no funciona XD

me estan enseñando try catch, hice esto para ver si funcionaba...

Código:
    public static void main(String[] args) {
        Clase r = new Clase ();
        try
        {
            for (int x=0;x<r.a.length+1;x++)
                r.a[x]=x;
        }
!        catch (IOException K)
        {
            System.err.println("Hubo un error"+K.getMessage());
        }
pero no funciona :S dice "exception IOException is never thrown in body of corresponding try statement" en la linea donde puse el "!", D:, yo puse igual que dice en el curso :l,

arriba de todo, puse import java.io.IOException;