Good for you for exploring
Java by writing code!
There's no DivideByZeroException. You probably want ArithmeticException, which is in java.lang. It only gets thrown when an integer is divided by integer zero.
Ugh, so does every integer division have to appear in a try block? No, fortunately, because ArithmeticException is a runtime exception. That means you don't need to catch it, and in fact you shouldn't. Runtime exceptions indicate conditions that are completely avoidable, so they should be dealt with by rewriting the code. In your example, if you were writing production code rather than experimental code, the presence of ArithmeticException would indicate that your code divided something by zero. Since division by zero is meaningless, the exception would indicate that part of your algorithm didn't mean anything!
It's best not to ship code that doesn't mean anything.
There's an animated illustration in Chapter 11 of "Ground-Up Java" that lets you design a snippet of exception-throwing code, and then animates the exception throwing and catching mechanism.