A little confused by this tiny program...
This is the program:
The part that confuses me is in the while loop...
public class EchoText
public static void main(String args) throws java.io.IOException
System.out.println("Please enter some text and press Enter!");
while ((ch = System.in.read()) != 13)
basically, i tye in "a"
then "b" it waits till I hit enter... then prints out "ab"
how come "ch" is not getting overwritten on every keypress?
I mean how come it does not only print out the last character (in this case it woud be "b")
I dont see any concatenation above...