Eclipse : how we take arguments for main when run

后端 未结 4 1372
臣服心动
臣服心动 2020-11-27 21:25

In Java, for a normal main method :

public static void main(String[] args){
    // code here
}

String[] args is used to take s

4条回答
  •  渐次进展
    2020-11-27 22:20

    In Eclipse you can set up a Run Configuration for the Java Application. Click on the green "play" button in the Launch toolbar (next to the bug icon which starts debugging).

    Within that configuration, you can set the working directory and command line arguments - and even prompt the user for command line arguments when it's run, using arguments like ${string_prompt:Foo}.

提交回复
热议问题