Ver Mensaje Individual
  #1 (permalink)  
Antiguo 09/06/2013, 02:40
Arkaitz
 
Fecha de Ingreso: agosto-2011
Ubicación: España
Mensajes: 445
Antigüedad: 12 años, 8 meses
Puntos: 89
Error: Missing return statement

Buenas,

Soy muy novato en esto de Java y me he cruzado con un error que no consigo resolver. En principio estoy intentando leer todas las líneas de un archivo y para decirle diferentes archivos he creado un método pero me está dando el error: Missing return statement.

Código Java:
Ver original
  1. import java.io.FileReader;
  2. import java.nio.charset.Charset;
  3. import java.nio.file.Files;
  4. import java.nio.file.Paths;
  5. import java.util.List;
  6.  
  7.  
  8. class Guardar
  9. {
  10.  
  11.        
  12.     String [] archivoLeer (String ruta)
  13.     { // Missing return statement
  14.         try
  15.         {
  16.         FileReader lectorDiccionario = new FileReader(ruta);
  17.          List <String> listararch = Files.readAllLines(Paths.get(ruta), Charset.defaultCharset());
  18.         String [] listarc = listararch.toArray(new String[listararch.size()]);
  19.         return listarc;
  20.                         }
  21.         catch (Exception e)
  22.                 {
  23.                     System.err.println ("Error:" + e);
  24.                    
  25.                 }
  26.                               }
  27.      
  28.              
  29.     }