Leave a Reply 1

Your email address will not be published. Required fields are marked *


renko

renko

Answer: E

Code question:
public class GradingProcess {
void verify(int marks) throws IndexOutOfBoundsException {
if (marks > 100) {
throw new MarksOutOfBoundsException();
}
if (marks > 50) {
System.out.print(“Pass”);
} else {
System.out.print(“Fail”);
}
}
public static void main(String[] args) {
int marks = Integer.parseInt(args[2]);
try {
new GradingProcess().verify(marks);
} catch(Exception e) {
System.out.println(e.getClass());
}
}
}
public class MarksOutOfBoundsException extends IndexOutOfBoundsException {

}
Output:
class MarksOutOfBoundsException