我在代码中使用注释,并尝试使用在运行时确定的值.
我将我的列表定义为static final(lst),并在此列表中添加一些元素.
当我使用时lst.get(i),我得到编译错误:
The value for annotation attribute must be a constant expression
Run Code Online (Sandbox Code Playgroud)
这个问题的解决方案是什么?
我尝试使用当前日期在我的服务器中创建文件夹.
所以我写了下一行:
$ mkdir # date +”%d-%m-%Y”
cd # date +”%d-%m-%Y”
Run Code Online (Sandbox Code Playgroud)
并保存为.sh,但对于somme reasom它不起作用.可能是什么原因?