> How To (Java) - Type in multiple names and numbers, store and display afterwards?

How To (Java) - Type in multiple names and numbers, store and display afterwards?

Posted at: 2014-12-18 
Use a scanner and a parallel array:

import java.util.Scanner;

public class NameAndNumbers {

public static void main(String[] args) {

Scanner sc = new Scanner(System.in);

int count = 5;

String name[] = new String[count];

int number[] = new int[count];

for (int i=0; i
System.out.print("Enter name: ");

name[i] = sc.nextLine();

System.out.print("Enter number: ");

number[i] = Integer.parseInt(sc.nextLine());

}

for (int i=0; i
System.out.println(name[i] + " " + number[i]);

}

}

}

Thank you so much! i'll take it from here :)

I want to be able to type in some names and their numbers into my java app and when they're typed in for them to be stored and displayed afterwards on screen. How is this possible? Thanks!