Exception Handling and CollectionQuiz

Exception Handling and CollectionQuiz

University

10 Qs

quiz-placeholder

Similar activities

Tut11 - Exceptions

Tut11 - Exceptions

University

8 Qs

Quiz 6 PBO

Quiz 6 PBO

University

10 Qs

CSE_A1_QUIZ 6(15-05-23)

CSE_A1_QUIZ 6(15-05-23)

University

13 Qs

Java Quiz 1

Java Quiz 1

University

10 Qs

Quiz on Java

Quiz on Java

University

12 Qs

Java Arrays

Java Arrays

University

10 Qs

Array List  Java y Excepciones

Array List Java y Excepciones

University

9 Qs

CP2 Topic 5

CP2 Topic 5

University

10 Qs

Exception Handling and CollectionQuiz

Exception Handling and CollectionQuiz

Assessment

Quiz

Computers

University

Hard

Created by

Ms. Asst.Prof

Used 3+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which class acts as a root for all java classes?

String

Object

Throwable

None of the above

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is not a kind of exception that is thrown by the JDBC method?

DataRounding

SQL Exception

DataTruncation

SQL Warning

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Predict the output of following Java program

class Main {

   public static void main(String args[]) {

      try {

         throw 10;

      }

      catch(int e) {

         System.out.println("Got the  Exception " + e);

      }

  }

}

Got the Exception 10

Got the Exception 0

Compiler Error

None

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Output of following Java program?

class Main {

   public static void main(String args[]) {

      int x = 0;

      int y = 10;

      int z = y/x;

  }

}

Compiler Error

Compiles fine but throws ArrayIndexOutOfBoundsException

Compiles and runs fine

Compiles fine but throws ArithmeticException exception

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

The closest common ancestor of RuntimeException, Error, IOException and ClassNotFoundException is:

Object

Exception

Throwable

Catchable

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following statements is true about Java's finally block?

The finally block is only executed if an exception is thrown in the try block

The finally block is only executed if an exception is thrown in the catch block

The finally block is only executed if an exception is not thrown in the try or catch block

The finally block is executed regardless of whether an exception is thrown in the try or catch block

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which interface provides key-value pair?

List

Set

Map

Collection

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?