www.HadoopExam.com

HadoopExam Learning Resources

Following are the Oracle Java and Oracle SQL Products Provided by HadoopExam Learning Resources
Free Core Java 1Z0-808 Training Java 1Z0-808 Questions and Answers Java 1Z0-809 Questions and Answers Questions for Oracle 1Z0-060 : Upgrade to Oracle Database 12c Administrator Oracle Database 12c: SQL Fundamentals

Question 8: You have been given below code, what is the behavior expected?

Question 8: You have been given below code, what is the behavior expected?

package com.hadoopexam;

class ParentException extends Exception {}

class ChildException extends ParentException {}

public class Welcome {

public void subscribeForCourse(String courseName, int fee) throws ParentException,ChildException {

if (courseName.length() < 6) {

throw new ParentException();

} else if (fee >= 60) {

throw new ChildException();

} else {

System.out.println("You are  allowed for this course");

}

}

public static void main(String[] args) throws ParentException {

Welcome t = new Welcome();

t.subscribeForCourse("Hadoop", 60);

}

}

1. It will print : You are  allowed for this course

2. It will print  : Hadoop

3. It will throw Exception in thread "main" com.hadoopexam.ChildException

4. It will give compile time error.

5. It will throw Exception in thread "main" com.hadoopexam.ParentException

Correct Answer : 3 Exp : 

I have cleared my Java 1Z0-808 Certification exam with 92% using this simulator

I have cleared my Java 1Z0-809 Certification exam with 96% using this simulator

You have no rights to post comments

You are here: Home Oracle Java 1Z0-809 Question 8: You have been given below code, what is the behavior expected?