I have a problem printing a String [] that is inside an ArrayList of objects when printing some prints as null.
Pasaporte - Jose Gregorio Silva Guedez.PDF
C:\Users\Javier Marín\Documents
5
Votantes: [
null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, ]
------------
Antecentes penales Apostillados - Jose Gregorio Silva Guedez.PDF
C:\Users\Javier Marín\Documents
6
Votantes: [
ramses, antonieta, marlyn, weber, simon, andres, null, null, null, null, null, null, null, null, null, null, null, null, null, null, ]
------------
More or less like that I get some if you print your content and others do not.
So I send it to print in the main
for(int i=0; i<p.listCanc.size();i++){
MetodosListCanc.impObj(p.listCanc.get(i));
}
I have already tried in several ways and I still give error here I leave the method that prints
public static void impObj(InfCanc i){
System.out.println(i.getName());
System.out.println(i.getLoc());
System.out.println(i.getVal());
System.out.println("Votantes: [");
String sl []=i.getVotantes();
for(int j=0; j<20;j++){
System.out.print(sl[j]+", ");
}
System.out.println("]");
System.out.println("------------");
}
/*public static void impObj(int i){
System.out.println(list.get(i).getName());
System.out.println(list.get(i).getLoc());
System.out.println(list.get(i).getVal());
System.out.println("Votantes: "+Arrays.toString(list.get(i).getVotantes()));
System.out.println("------------");
}*/
in both ways I get the same printing error with some objects.