private void ioTest()
{
try
{
int intRead = -1;
while(intRead != '0')
{
intRead = System.in.read();
//System.out.println(intRead);
char a = (char)intRead;
System.out.println(a);
}
}
catch (IOException e)
{
e.printStackTrace();
}
}
{
try
{
int intRead = -1;
while(intRead != '0')
{
intRead = System.in.read();
//System.out.println(intRead);
char a = (char)intRead;
System.out.println(a);
}
}
catch (IOException e)
{
e.printStackTrace();
}
}
import javax.swing.*;
public class Test
{public static void main(String []args)
{ String astring=JOptionPane.showInputDialog("now you can input a string");
System.out.println(astring);
System.exit(0);
}}
public class CharInput {
public static void main (String args[]) throws java.io.IOException {
String s;
InputStreamReader ir;
BufferedReader in;
ir = new InputStreamReader(System.in);
in = new BufferedReader(ir);
while ((s = in.readLine()) != null) {
System.out.println("Read: " + s);
}
}
}