hello guys iam new in this forum and comunity can you please help me with my code?
i must input a string or name depending on how any time i like and out u it at the end
but my code only ouputed the last name i enetered
and it skipped the loop instead i dont know why
import java.io.*;
public class name{
public static void main(String args[]) throws IOException {
BufferedReader in = new BufferedReader (new InputStreamReader (System.in));
String[] input = new String[100];
int i=0,ctr=1;
System.out.print("Enter Name:\t");
input = in.readLine();
do{
System.out.print("Enter Name:\t");
input[i] = in.readLine();
i++;
}while(input[i]!=input);
for (int j = 0; j < i; j++)
System.out.println(input[j]);
}
}
:-/