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

📄 keyboardinput.java

📁 几个简单的java学习代码
💻 JAVA
字号:
import java.io.*;

public class KeyboardInput {
 	public static void main (String args[]) {
	 	String s;
		 // Create a buffered reader to read
		 // each line from the keyboard.
		 InputStreamReader ir = new InputStreamReader(System.in);
		 BufferedReader in = new BufferedReader(ir);
                 
		 System.out.println("Type bye exit.");

		 try {
			 // Read each input line and echo it to the screen.
			 s = in.readLine();
              		 while ( s != null ) {
                            if(s.equals("bye")){
                                 break;
                            }else{
				 System.out.println("Read: " + s);
				 s = in.readLine();
                            }
			 }

			 // Close the buffered reader.
			 in.close();
		 } catch (IOException e) { // Catch any IO exceptions.
			 e.printStackTrace();
		 }
	 }
 }

⌨️ 快捷键说明

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