简体   繁体   English

Java批量读取字符串

[英]Java read String on batch

I have a batch as follows: 我有一批,如下所示:

@echo off
java Main 127.0.0.1
pause

Now I want the number after 'Main' in the code above to be a String, so that you can change the String by editing the batch file. 现在,我希望上面代码中“ Main”之后的数字是一个字符串,以便您可以通过编辑批处理文件来更改字符串。

public static void main (String args[]) {
....
String IP_STRING=args[0];
....
}

Does this work? 这样行吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM