First version
This commit is contained in:
commit
243e92a9dd
84 files changed
+4012
No files matched your search
@@ -0,0 +1,16 @@
|
||||
import java.lang.management.ManagementFactory;
|
||||
import java.util.Scanner;
|
||||
public class Sum {
|
||||
public static void main(String[] args) {
|
||||
if (!System.getProperty("java.version").equals("25.0.4.1"))
|
||||
throw new IllegalStateException("Java 25.0.4.1 is required");
|
||||
var vmArgs = ManagementFactory.getRuntimeMXBean().getInputArguments();
|
||||
for (String flag : new String[]{"-Dfile.encoding=UTF-8", "-XX:+UseSerialGC", "-Xss64m", "-XX:TieredStopAtLevel=1", "-XX:ActiveProcessorCount=2", "-Xms2048m", "-Xmx2048m"})
|
||||
if (!vmArgs.contains(flag)) throw new IllegalStateException("Missing " + flag);
|
||||
System.out.println("Java " + System.getProperty("java.version"));
|
||||
System.out.println("VM: " + vmArgs);
|
||||
System.out.print("Input two integers: ");
|
||||
Scanner in = new Scanner(System.in);
|
||||
System.out.println("SUM = " + (in.nextLong() + in.nextLong()));
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user