📄 printpublicmembers.java
字号:
// Introduced in Chapter 17import java.io.*;import java.util.Scanner;/** Print all lines containing the substring "public". */public class PrintPublicMembers { /** Run on the file specified as args[0]. */ public static void main(String[] args) throws IOException { File file = new File(args[0]); Scanner in = new Scanner(file); while (in.hasNextLine()) { String line = in.nextLine(); if (line.contains("public")) { System.out.println(line); } } } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -