Variable File with output [Ljava.lang.String; @

1

When I do a Sysout of my File type variable, I get this output:

[Ljava.lang.String;@3e92957f

And my sysout looks like this:

System.out.println(entrada.getPath() + " " + saida.getPath());

The funny thing is that in saida.getPath() output is exactly what I want. Does anyone know why?

    
asked by anonymous 14.06.2016 / 08:02

1 answer

1

I found the error, using the instanceof method on the object, I was able to transform it into String correct. For those who have the same doubt, here is the code:

for (Object obj : objArr) {
     if (objeto instanceof String[]) {
     String[] strArray = (String[]) objeto;
     System.out.println(Arrays.toString(strArray));
    }
}
    
14.06.2016 / 08:26