Untitled
public text v1 · immutablepublic void AddCar (String name) throws IOException
{
int count = 0;
String [] CarArr = new String [20];
BufferedReader in = new BufferedReader (new FileReader ("Cars.txt"));
String line = in.readLine ();
CarArr [count] = line;
count++;
line = in.readLine ();
while (line != null)
{
CarArr [count] = line;
count++;
line = in.readLine ();
}
in.close ();
count = 0;
int x = 2;
while (x != 1)
{
System.out.println (CarArr [count]);
count++;
}
}