Hello.
Your question is ambiguous (unclear).
Suppose you have collection say list. In this list you have added various objects of type Student. In a Student object you have id and name.
...