Quiz 8 (Exercise for Chap. 14)
Some review questions from Horstmann's Big Java.
What is a checked exception?
Is NullPointerException checked or unchecked?
- If your method declares that it throws IOException then will
- When your program executes a throw statement, which statement
is executed next?
- What happens if an exception does not have a matching catch clause?
- What can your program do with the exception object that a catch
- Is the type of the exception object always the same as the type
declared in the catch clause that catches it?
Ask the user for an integer and if you receive it print the square,
if it is not an integer, then give the user a second chance, but not
a third chance.
import javax.swing.JOptionPane ;
public class Quiz8
public static void main(String args)
int tries = 0 ;
String input = JOptionPane.showInputDialog("Please enter integer") ;