i need a create a list that contains in each iteration an int ,date and a note (String)
so what i need is something like this : List A ={[5,12/12/2020, “note1″],[6,11/01/2021,”note2”],…} what i need is the declaration for this . and i knew that i can change it to a list<list< String >> then change everything back from String to the type of thing that i want or declare a class that contains that information and make a list of that class but what i’m asking is there a way to make without doing that (without changing to String and without declaring a new class) . thank you for any help you offer
Advertisement
Answer
Is that what you are looking for?
List<Object[]> lista = new ArrayList<Object[]>(); lista.add(new Object[] {5, LocalDate.of(12,12,2020), "note1"}); lista.add(new Object[] {6, LocalDate.of(11,1,2021), "note2"});