JAVA
(a) [3 marks] Write the programmer’s perspective of a method
header named “doProcess” that is public,
does not return any value, has one input argument of type
String and throws a “checked”
IllegalArgumentException.
Only the method header is required.
(b) [4 marks] Now write the user’s perspective code that
calls “doProcess” and handles the checked exception.
Just the skeleton is required not the actual code for the user’s
method.
(c) [1 mark] Does the method header require any changes
if it throws only unchecked exceptions? (YES/NO)
(d) [1 mark] Can a method throw more than one type of
checked exception? (YES/NO)
(e) [1 mark] Can programmers write their own classes of
exceptions in Java? (YES/NO)
(Please write your essay question on a separate piece of
paper)
JAVA (a) [3 marks] Write the programmer’s perspective of a method header named “doProcess” that is public, does not retu
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am