I am executing a simple java application in eclipse.
Sample code:
BufferedReader input = new BufferedReader( new InputStreamReader(System.in));
String line;
while((line = input.readLine()) != null && line.length() != 0)
{
System.out.println("------"+line);
}
In the above code the readline() method hangs when reading the last line of my input. I have gone through some threads and understood that it waits for the end of line. I don't want to give any '\n' or '\r' at the end of my input in the console. so how to handle this in the code.