我刚开始学习Scala.我已经为IntelliJ安装了Scala插件,并创建了一个新的Scala项目.但是当我右键单击src文件夹来创建一个新的Scala类时,没有选项可以这样做.我错过了什么吗?
这段代码运行正常.重新启动计算机时,它给出了错误:
ERROR: org.openjdk.jmh.runner.RunnerException:
ERROR: Exception while trying to acquire the JMH lock (C:\WINDOWS\/jmh.lock):
Access is denied, exiting. Use -Djmh.ignoreLock=true to forcefully continue.
at org.openjdk.jmh.runner.Runner.run(Runner.java:213)
at org.openjdk.jmh.Main.main(Main.java:71)
Run Code Online (Sandbox Code Playgroud)
Google-int的错误没有帮助.有人能告诉我如何解决它吗?
@State(Scope.Thread)
public class test {
public ConcurrentHashMap<String,Integer> i = new ConcurrentHashMap<String, Integer>(10000);
public ArrayList<String> k = new ArrayList<String>(10000);
public int p=0;
public void setup(){
for(int m=0;m<1000;m++){
int j=ThreadLocalRandom.current().nextInt(0,10000);
String jk=Integer.toString(j);
k.add(jk);
i.put(jk,j);
}
}
@Benchmark
@BenchmarkMode(Mode.Throughput)
@OutputTimeUnit(TimeUnit.MILLISECONDS)
@Warmup(iterations = 3)
@Measurement(iterations = 5)
public void putKey(){
int n=ThreadLocalRandom.current().nextInt(0,10000);
String nk=Integer.toString(n);
k.add(nk);
i.put(nk,n);
} …Run Code Online (Sandbox Code Playgroud)