Código:
La clase estructura es asi:public static void main(String args[]){
Estructura e=new Estructura();
try{
e.cargarDatos();
}
catch (Exception er){
es.mensaje(er.toString());
}
Código:
Cuando entro en el programa la primera vez se muestra el mensaje "Error declass Estructura {
private File f;
private Vector lista;
public Estructura(){
f=new File("datos.txt");
lista=new Vector();
}
public void cargarDatos() throws Exception{
if(!f.exists())
throw new Exception ("Error en acceso al fichero");
else {
if(!f.canRead())
throw new Exception ("Error en lectura del fichero");
else {
FileInputStream fis=new FileInputStream(f);
...............
fis.close();
if (cadena.length()>1)
volcar(cadena);
}
}
}
acceso al fichero" recogido en la excepción. Es que al hacer new
File("datos.txt") no se crea el fichero?
Saludos

