package com.sample; import java.io.*; import java.util.*; public class TestRead { @SuppressWarnings({ "unused", "resource" }) public static void main(String[] args) throws IOException { File file; Date d=new Date(); ArrayList l= new ArrayList<>(); file = new File("myfile.txt"); if (!file.exists()) { file.createNewFile(); } BufferedWriter bw =new BufferedWriter(new FileWriter(file,true)); PrintWriter pw = new PrintWriter(bw); int i; String name; String email; String phone; Scanner input =new Scanner(System.in); System.out.println("Welcome to Costumer Deatails page"); Customer names[]=new Customer[1000]; System.out.println("Are you creating a record:"); String userReply=input.next(); for (i = 1; "Y".equalsIgnoreCase(userReply); i++) { System.out.println("\nEnter Customer"+ "[" + i + "]"+ "details ::"); System.out.print("Enter the name: "); name = input.next(); System.out.print("Enter the Email: "); email = input.next(); System.out.print("Enter the PhoneNo: "); phone = input.next(); System.out.println("\nDo you want to enter more customers : "); userReply=input.next(); names[i]=new Customer(); names[i].name=name; names[i].email=email; names[i].phone=phone; } System.out.println("User Details Entered are ::\n"); pw.println("****************************"); pw.println(d.toString()); for(int j=1;j