multiple values
I want to have a 3 attributes for a certain group of items. for example: name - bob country- US job- developer what can i use to store all 3 in one place? arrays can only store 1 (the specific index), and hashmap can only store 2 (value and key). i want to be able to access a value at any point. if i call the country, i want to return US (so 6 labels in total). i was thinking have a hundred arrays would be very inefficent, so what could i do?
5/25/2019 12:21:19 AM
koala 🐨
3 Answers
New Answerpublic class Person { String name; String country; String job; ... } In main(): Person p1=new Person; Person p2=new Person; ...
Jay Matthews thank you, I thought having too many classes would be inefficient but it's fine for what I have to do