im trying to do this for fun but i cant figure out why i keep getting "null" instead of previous entry.
ps. this isnt homework
Thank you
public class GetUser {
public static void main(String[] args) {
String name;
String a [];
char x='y';
int i;
int n=1;
do{
System.out.println();
System.out.println("Please enter a name");
a = new String [n];
a[n-1]= ITI1120.readString();
System.out.println ();
System.out.println("Do you want to add more names? (y/n)");
x= ITI1120.readChar();
System.out.println("Your list so far is:");
for(i=0; i<n; i++){
System.out.println(a[i]);
}
n=n+1;
}while(x=='y');
}
}