package com.sample; import java.util.ArrayList; import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.io.PrintWriter; import java.util.*; public class RecordEntry { public static void main(String[] args) throws IOException { // TODO Auto-generated method stub int i,j; String userReply; Date d=new Date(); File f=new File("user_details.txt"); if(!f.exists()) { f.createNewFile(); } else { System.out.println("File already exists"); } BufferedWriter bw=new BufferedWriter(new FileWriter(f,true)); PrintWriter pw=new PrintWriter(bw); List l= new ArrayList(); Scanner sc=new Scanner(System.in); CustomerList c; System.out.println("Welcome to Record Entry"); System.out.print("Do you want to create a Record:"); userReply=sc.next(); for(i=1;"y".equalsIgnoreCase(userReply);i++) { c=new CustomerList(); //CustomerList c1=new CustomerList(); //System.out.println("Record"+ i); System.out.print("Enter name:"); c.setName(sc.next()); System.out.print("Enter email:"); c.setEmail(sc.next()); System.out.print("Enter Phone_Number:"); c.setPhone(sc.nextInt()); System.out.print("Do you want to create another record:"); userReply=sc.next(); l.add(c); } System.out.println("***************test***************"); for(int k=0;k