hi
I wrote a java program with project builder and whenI run it this line does not work inChar = System.in.read();
It looks like I can write but i can not read why ?
here is the program :
//
// ReadHello.java
//
import java.io.*;
public class ReadHello {
public static void main(String args[]) {
int inChar;
System.out.println("Enter a character");
try {
inChar = System.in.read();
System.out.print("You entered:");
System.out.println(inChar);
}
catch (IOException e) {
System.out.println("error reading from user");
}
}
}
thanks
jsn
I wrote a java program with project builder and whenI run it this line does not work inChar = System.in.read();
It looks like I can write but i can not read why ?
here is the program :
//
// ReadHello.java
//
import java.io.*;
public class ReadHello {
public static void main(String args[]) {
int inChar;
System.out.println("Enter a character");
try {
inChar = System.in.read();
System.out.print("You entered:");
System.out.println(inChar);
}
catch (IOException e) {
System.out.println("error reading from user");
}
}
}
thanks
jsn