stabilize roc_panic

This commit is contained in:
dankeyy 2023-03-18 23:39:12 +02:00
parent a750084580
commit 773b5be769
No known key found for this signature in database
GPG key ID: 9EBEF7DB1A70533D
2 changed files with 28 additions and 24 deletions

View file

@ -12,7 +12,7 @@ public class Demo {
public static native int[] mulArrByScalar(int[] arr, int scalar);
public static native long factorial(long n);
public static native long factorial(long n) throws RuntimeException;
public static void main(String[] args) {
@ -23,7 +23,7 @@ public class Demo {
// array demo
int[] arr = {10, 20, 30, 40};
int x = 3;
System.out.println("Array " + Arrays.toString(arr) +
System.out.println(Arrays.toString(arr) +
" multipled by " + x +
" results in " + Arrays.toString(mulArrByScalar(arr, x)) +
"\n");
@ -33,7 +33,7 @@ public class Demo {
// this will panic from the roc side if n is negative
// and in turn will throw a JVM RuntimeException
long n = 5;
System.out.println("Factorial of " + n + " is " + factorial(n) + "\n");
System.out.println("Factorial of " + n + " is " + factorial(n));
}
}