debug3_4.java

来自「程序练习中包括书中实例程序代码和练习中要用到的代码,是压缩文件」· Java 代码 · 共 18 行

JAVA
18
字号
package questions.c3;
public class Debug3_4 {
   public static void main( String[] args ) {
      String[12] months;
      months = { "Jan", "Feb", "Mar",
                 "Apr", "May", "Jun",
                 "Jul", "Aug", "Sep",
                 "Oct", "Nov", "Dec" };
      if ( args.length >= 1 ) {
         int index = Integer.parseInt( args[0] );
         if ( index > 0 && index < 12 ) {
            // adjust index by one so that entering 1
            // will display "Jan"
            System.out.println( months[index] );
         }
      }
   }
}

⌨️ 快捷键说明

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