Question: I am getting `Object obj` from a method. `obj = String[7]`. I am having difficulty in getting these 7 Strings and print them.

How can I get Strings out of it?

Answer: 
```
Object obj = ...;
...
if (obj instanceof String[]) {
  for (String element : ((String[]) obj)) { ... }
}

```

If you need to deal with various types of arrays, I would look into reflection APIs.
If you have no idea whether an array is an Object array or primitive array (which means you can't cast it) You can use the Array class.

```
Object arr = new int[]{1, 2, 3};
for (int i = 0, len = Array.getLength(arr); i < len; i++)
    System.out.println(Array.get(arr, i));

```

If you know its a String[], make it that class.