Q:

How do I store "multiple pieces of information" of an item in Java

I need a Data Structure that will allow me to store at least 2 pieces of data per item. I want the items to be store in the order they were inserted in.
Example:
Insert (xyz, string) ... insert (789, number)
System.out.println( dataStruct );

will print out (xyz, string) then (789,number)
If possible, please show some sample codes. Thank you!

A:

public class Store {
String str1;
String str2;

public Store(String string1, String string2) {
    str1 = string1;
    str2 = string2;
}

public static void main(String[] args) {

    Store[] s = new Store[10]; // size
    for (int i = 0; i < s.length; i++) {
        s[i] = new Store("A", "B");
        System.out.println(s[i].str1);
        System.out.println(s[i].str2);

    }

}
}

I think this is what you are searching for . This is  C like structure. Try this.
This will help you to insert more than 2 piece of data per item  by just doing little changes. And order will be maintained too.

