Code:
import java.util.Scanner;
public class ForgetfulMachine
{
public static void main( String [] args )
{
Scanner io = new Scanner(System.in);
System.out.println("Enter comments");
String comment = io.nextLine();
System.out.println("The comment you entered is:" + comment);
}
}
It appears that the line where I instantiate a Scanner object, it blocks.
Code:
rgonzale@kronos:~1012 !gcj
gcj --main=ForgetfulMachine ForgetfulMachine.java
rgonzale@kronos:~1013 ./a.out
Enter comments
Wow
The comment you entered is:
rgonzale@kronos:~1014 ./a.out
Wow
Enter comments
The comment you entered is:Wow
I'm wondering if there is something with the input stream in relation to Linux command line that is causing this.