Warning: include_once(): http:// wrapper is disabled in the server configuration by allow_url_include=0 in /home/users/2/moriya-h5/web/confrage/java/java/command_line_param/command_line_param.html on line 2

Warning: include_once(http://www.confrage.com/bin/header.php): failed to open stream: no suitable wrapper could be found in /home/users/2/moriya-h5/web/confrage/java/java/command_line_param/command_line_param.html on line 2

Warning: include_once(): Failed opening 'http://www.confrage.com/bin/header.php' for inclusion (include_path='.:/usr/local/php/5.6/lib/php') in /home/users/2/moriya-h5/web/confrage/java/java/command_line_param/command_line_param.html on line 2
コマンドライン引数 | Java | 株式会社CONFRAGE
Warning: include_once(/home/sites/heteml/users/m/o/r/moriya-h5/web/confrage/bin/menu.php): failed to open stream: No such file or directory in /home/users/2/moriya-h5/web/confrage/java/java/command_line_param/command_line_param.html on line 17

Warning: include_once(): Failed opening '/home/sites/heteml/users/m/o/r/moriya-h5/web/confrage/bin/menu.php' for inclusion (include_path='.:/usr/local/php/5.6/lib/php') in /home/users/2/moriya-h5/web/confrage/java/java/command_line_param/command_line_param.html on line 17
コマンドライン引数
javaではプログラムを実行する際に引数を渡すことが出来ます。
この引数を、コマンドライン引数といいます。
コマンドライン引数はmainメソッドに対して引き渡されます。
下記のようなクラスがあるとします。この場合、コマンドライン引数はargs[]配列に格納されます。

public Test{
    public static void main(String[] args){
        System.out.println(args[args.length - 1]);
    }
}

// 実行
java Test 0 1 2
上記のように実行します。
実行時の引数 0 1 2 がそれぞれ args[0],args[1],args[2] に格納されます。
決め打ちで、 String[] args としていますが、別に String[] param というように変数名に決まりはありません。

Back to top

Information

Warning: include_once(/home/sites/heteml/users/m/o/r/moriya-h5/web/confrage/bin/side_bar.php): failed to open stream: No such file or directory in /home/users/2/moriya-h5/web/confrage/java/java/command_line_param/command_line_param.html on line 71

Warning: include_once(): Failed opening '/home/sites/heteml/users/m/o/r/moriya-h5/web/confrage/bin/side_bar.php' for inclusion (include_path='.:/usr/local/php/5.6/lib/php') in /home/users/2/moriya-h5/web/confrage/java/java/command_line_param/command_line_param.html on line 71

Warning: include_once(/home/sites/heteml/users/m/o/r/moriya-h5/web/confrage/bin/seo.php): failed to open stream: No such file or directory in /home/users/2/moriya-h5/web/confrage/java/java/command_line_param/command_line_param.html on line 80

Warning: include_once(): Failed opening '/home/sites/heteml/users/m/o/r/moriya-h5/web/confrage/bin/seo.php' for inclusion (include_path='.:/usr/local/php/5.6/lib/php') in /home/users/2/moriya-h5/web/confrage/java/java/command_line_param/command_line_param.html on line 80