Wenn ich eine meiner benutzerdefinierten Ausnahmen (z. B. MyCustomKotlinException.kt) innerhalb des Java-Codes auslöste, wird die Ausnahme nicht abgefangen (siehe Code unten).
Code: Select all
// Example.java
package foo
import java.util.*;
import java.lang.*;
import java.io.*;
import foo.MyCustomKotlinException;
class Example
{
public static void main (String[] args)
{
try {
// Do some stuff
// if Error
MyCustomKotlinException e = new MyCustomKotlinException("Error Message");
throw e;
} catch (MyCustomKotlinException e) { //
Mobile version