how can I get it to go back to start another directory when the user types yes and also how do I print the arraylist out using a print format
thanks
import java.util.ArrayList;
import java.util.Scanner;
public class AAA
{
public static void main(String[] args)
{
ArrayList<String> name = new ArrayList<String>();
ArrayList<Integer> phone = new ArrayList<Integer>();
Scanner scanner = new Scanner(System.in);
{
System.out.println("Please enter your name: ");
name.add(scanner.next());
System.out.println("Please enter your number: ");
phone.add(scanner.nextInt());
System.out.println("Do you want to add a directory yes/no?");
String answer = scanner.nextLine();
if (answer.equals("yes"));
//want it to go back to start another direcotry here
else
{
System.out.println("Thanks for adding to the directory");
System.out.println(answer());
}
}
}
}