Can someone please debug this for me? Java code to copy below public class Throw
ID: 3853273 • Letter: C
Question
Can someone please debug this for me?
Java
code to copy below
public class ThrowEagleExceptionTest {
public static void main(String[] args)
{
try {
EagleLanding();
}
catch(EagleLandingException badEagle)
{
System.out.printf("%s ", badEagle.getMessage());
System.exit(9999);
}
}
private static void EagleLanding()
{
EagleLandingException("There is a problem with the Eagle!");
}
}
Explanation / Answer
Hi i make small change to your program
now it can compile and run also:
class ThrowEagleExceptionTest {
public static void main(String[] args)
{
try {
EagleLanding();
}
catch(Exception badEagle)
{
System.out.printf("%s ", badEagle.getMessage());
System.exit(9999);
}
}
private static void EagleLanding()
{
System.out.println("There is a problem with the Eagle!");
}
}