SHARE
TWEET

sajdfk

a guest Oct 23rd, 2019 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.         XStream xstream = new XStream();
  2.  
  3.      
  4.        
  5.         ListaCursos listadoTodos = (ListaCursos)xstream.fromXML(new FileInputStream("C:\\Users\\usuario\\Desktop\\NuevaCarpeta\\cursoXStream.xml"));
  6.         System.out.println("Numero de curso: " + listadoTodos.getListaCursos().size());
  7.         List<Curso> listaCursos= new ArrayList<Curso>();
  8.         listaCursos = listadoTodos.getListaCursos();
  9.        
  10.         Iterator iterador = listaCursos.listIterator(); //iterador dr los elementos
  11.        
  12.        
  13.         while( iterador.hasNext()) {
  14.             Curso c = (Curso) iterador.next();
  15.                 System.out.println("Nombre: " + c.getNombre() + " Dificultad:  " + c.getDificultad()+ " Id departamento: "
  16.                + c.getIdDepartamento() + " Precio: "+ c.getPrecio());
  17.  
  18.         }
  19.         System.out.println("Fin del listado...");
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top