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

📄 ls.java

📁 用command模式写的一个简单的java 程序
💻 JAVA
字号:
/*******************************************************************************  Filename    :ls.java
*  Description :ls command
*
*  Author      :xunzy
*
*  History     :2004-02-16   Created******************************************************************************/import java.util.Vector;import java.io.*;public class ls implements Command {  public void execute(File c, Vector v) throws CommandException {                    // Check for current dir; throw an exception if there is null    if (FileSystemShell.getCurrentDir() == null)      throw new CommandException(new Exception(),         "Error: no current context.");    // Call list() and then loop through the results, printing the names      String[] enum = c.list();      int i=0;                      while (i<enum.length) {        System.out.println(enum[i]);        i++;      }  }  public void help() { System.out.println("Usage: list [dirName]"); }}

⌨️ 快捷键说明

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