Get Object id []

-3

I need to get the id of these objects.

Object[] classe = getNames().toArray();

String[] strings = Arrays.stream(classe ).map(Object::toString).
                toArray(String[]::new);

for (int i=0;i<strings.length;i++)
        {
            Integer id =strings[i].id;
        }

Theoretically this would be the case, but I can not get the id. In the console the whole object appears to me.

    
asked by anonymous 01.06.2018 / 19:52

1 answer

0

Impossible the way you are doing since your String[] strings array is array of String and the String class does not have an id property.

    
01.06.2018 / 20:04