aports/community/openjdk8-loongarch/Example.java
Celeste 82181afd55 community/openjdk8-loongarch: new aport
https://github.com/loongson/jdk8u
Loongarch port of OpenJDK 8

Only enabled for arch=loongarch64
2024-09-12 14:09:19 +00:00

17 lines
490 B
Java

// Copied from https://www.graalvm.org/22.0/reference-manual/native-image/.
public class Example {
public static void main(String[] args) {
String str = "Native Image is awesome";
String reversed = reverseString(str);
System.out.println("The reversed string is: " + reversed);
}
public static String reverseString(String str) {
if (str.isEmpty())
return str;
return reverseString(str.substring(1)) + str.charAt(0);
}
}