I want to create list with object like
i.e. for every object there is entries of two strings that related to him.
i try to find in the net some kind of example and maybe I should to it with class
but I not sure how to connect the object to the strings.
<object,String,String>
Like
Object1 String1 String10
Object2 String2 String3
The answer depends on what you want, which is not entirely clear. You could either have a class containing two strings e.g.
And then have a
List<Pair> myList = new List<>();EDIT: Just saw your edit – probably don’t want this one, unless you updated your class to contain the object as a field also e.g.
public object him; public String a,b;Or, if you have an existing object that you want associated with each pair of strings, which it sounds like you might have, you’ll want to use a
Map, likeHashMap:See the javadocs for HashMap