<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          CLOPSJava命令行參數(shù)處理

          聯(lián)合創(chuàng)作 · 2023-09-28 21:04

          CLOPS 是一個用來處理 Java 程序中的命令行參數(shù)的類庫。

          示例代碼:

          import java.io.File;
          import generated.WcParser;
          import generated.WcOptionsInterface;

          public class Main {
            public static void main(String[] args) throws Exception {
              WcParser parser = new WcParser();
              if (!parser.parse(args)) {
                System.out.println("Usage: java Main [OPTIONS] file...");
                System.exit(1);
              }
              WcOptionsInterface opt = parser.getOptionStore();
              if (opt.isWordsSet())
                System.out.println("I should print a word count.");
              if (opt.isBytesSet())
                System.out.println("I should print a byte count.");
              for (File f : opt.getFiles()) checkFile(f);
            }

            public static void checkFile(File f) {
              System.out.print("The file " + f.getPath());
              if (f.exists())
                System.out.println(" exists.");
              else
                System.out.println(" does not exist.");
            }
          }

          瀏覽 17
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          編輯 分享
          舉報
          評論
          圖片
          表情
          推薦
          點贊
          評論
          收藏
          分享

          手機掃一掃分享

          編輯 分享
          舉報
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  日本黄色小视频电影 | 无码日韩人妻精品久久蜜桃 | 日本三级韩国三级99久久 | 无码天堂| 91三级成人视频 |