```
String temp = sgDetails.get(0).sgShift;

```

In this we have an arraylist sgdetails that stores objects of guards with fields such as name, id, sal and so on. I am unable to access shift of object stored at first index of arraylist.