i am new to java. i want to add user input into a vector and i want to search them ....
Scanner input = new Scanner(System.in);
String Name;
String Address;
Name = input.nextLine();
Address = input.nextLine();
how to put those 2 input into a vector and those Name and Address must work like a pair i mean if i store Name = john and Address = Canada(whatever) ... if i search John it will show ... John from Canada. sumthing like this. and if i add like 50 name and address into that vector i want to search them by name ... how to do it?
as i dont know how vector works plz show me how to store user input and how to search them.
it will be kind if you show me the same thing in Arraylist.