⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 keyboard.java

📁 航班订座系统~java的作业
💻 JAVA
字号:
// read a text file and match certain items on separate lines



import java.io.*;



class Keyboard

{

InputStreamReader inStream;

BufferedReader stdInStream;



// override implicit constructor to open the input stream and attach it

// to a stream reader

Keyboard()

{

inStream = new InputStreamReader(System.in);

stdInStream = new BufferedReader(inStream);

}



// get one character

char getChar(String str)

{

char aChar = ' ';


System.out.println(str);
try

{

aChar = (char)stdInStream.read();

}

// empty exception handling

catch (Exception e)

{

}

return aChar;

} // end of getChar()



// get a whole line and return it as a String

String getString(String str2)

{

String aString = " ";
System.out.println(str2);



try

{

aString = (String)stdInStream.readLine();

}

// empty exception handling

catch (Exception e)

{

}

return aString;

} // end of getString()



} // end of Keyboard class



⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -