Olá Pessoal,
Estou não estou conseguindo resolver os erros deste código abaixo:
public class TestExceptions {
public static void main(String[] args) {
String test = "no";
try
{
System.out.println("start try");
doRisky(test);
System.out.println("end try");
}
catch (ScaryException se)
{
System.out.println("finally");
}
System.out.println("end of main");
}
static void doRisky(String test) throws ScaryException
{
System.out.println("start risky");
if ("yes".equals(test))
{
throw new ScaryException();
}
System.out.println("end risky");
return;
}
}
Os erros gerados:
C:\Use a Cabeça\Capitulo 11\TestExceptions.java:18: cannot find symbol
symbol : class ScaryException
location: class TestExceptions
static void doRisky(String test) throws ScaryException
^
C:\Use a Cabeça\Capitulo 11\TestExceptions.java:11: cannot find symbol
symbol : class ScaryException
location: class TestExceptions
catch (ScaryException se)
^
C:\Use a Cabeça\Capitulo 11\TestExceptions.java:23: cannot find symbol
symbol : class ScaryException
location: class TestExceptions
throw new ScaryException();
^
3 errors
Process completed.
Alguém pode me dar uma luz??
Abraços