This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
The routine main() won't compile because it's calling num(), which declares that it throws MyException. That means main() either has to catch MyException, or it has to also declare that it throws this same exception.
These are your two choices whenever you call a method that throws a checked exception type. You either have to catch it, or you have to "pass it on" by declaring that your calling method throws it, too.