import java.util.*;
import java.io.*;
class contacts
{
static int i=-1,j;
static char a;
static String[] name = new String[10];
static String[] email = new String[10];
static String[] mobile = new String[10];
static String[] telno = new String[10];
public static void main(String args[]) throws IOException
{
do
{
i++;
Scanner ob = new Scanner(System.in);
System.out.println("Enter Name");
name[i]=ob.nextLine();
System.out.println("Enter Email");
email[i]=ob.nextLine();
System.out.println("Enter MObile no");
mobile[i]=ob.nextLine();
System.out.println("Enter Tel no");
telno[i]=ob.nextLine();
ArrayList<String> contacts = new ArrayList<String>();
contacts=new ArrayList<String>();
contacts.add(name[i]);
contacts.add(email[i]);
contacts.add(mobile[i]);
contacts.add(telno[i]);
System.out.println(contacts);
System.out.println("do u want to continue y/n");
a=ob.nextLine().charAt(0);
}while(a=='y');
FileWriter f = new FileWriter("info.txt");
for(j=0;j<name.length;j++)
f.write(name[j]);
for(j=0;j<email.length;j++)
f.write(email[j]);
for(j=0;j<mobile.length;j++)
f.write(mobile[j]);
for(j=0;j<telno.length;j++)
f.write(telno[j]);
f.close();
}
}