使用Console
flush(),让缓冲区中的数据,尽快写到硬盘中,防止数据丢失
format()
reader()
readLine()
writer()
*/
Console console = System.console();
/*
System.out.println(console);
char[] passwd ;
if((console = System.console()) != null && (passwd = console.readPassword("%s","Password:")) != null)
{
//Arrays.fill(passwd,' ');
System.out.println(new String(passwd));
}
*/
console.format("%s%n","abc");
console.printf("%s", "88787");
Reader br = console.reader();
char[] ch = new char[5];
//int n = br.read(ch);
//System.out.println(n+":"+new String(ch));
console.readLine("年后");
console.readPassword();
PrintWriter writer = console.writer();
writer.printf("asdfasdf");