Lab 6
Lab 6
Programming I
LAB: 06
JPI - Lab 6 – Exception and more class
Java Programming I
Lab 6
Objectives:
In this session, you will be practicing with:
2
JPI - Lab 6 – Exception and more class
private int canThrowCheckedException() throws Exception{
throw new Exception("Failure");
}
}
Questions:
● Distinguishing un checked Checked Exception and Exception?
Questions:
✔ Compile and run the test class.
✔ Please correct the above code to be able to catch every Exception that.
3
JPI - Lab 6 – Exception and more class
public static void main(String[] args) {
Object obj1 = new Object();
System.out.println(obj1);
Questions:
✔ Compile and run the test class.
I
Exercise 2: