在命令行Java应用程序中,您可以通过args
参数获取参数:
public static void main(String[] args) {
我如何在锡兰做类似的事情?我尝试复制Java样式:
shared void run(String[] args) {
但出现错误,因为不允许这样做:
ceylon run: Cannot run toplevel method 'test.project.run':
it should have no parameters or they should all have default values.
我一直在阅读ceylon-lang.org导览,但没有找到答案。
使用process
语言模块中的顶级对象。
String[] arguments = process.arguments;
String? argument = process.namedArgumentValue("name");
if (process.namedArgumentPresent("name")) {
// ...
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句