Search Header Logo

Java-QUIZ-PSGRK

Authored by saranya pravin

Computers

University

Used 1+ times

Java-QUIZ-PSGRK
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

What is the advantage of Exception Handling?

To avoid abnormal termination of a program

To find out errors

To Debug program

None of these

2.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Which of the following key word is optional in Exception handling program?

try

catch

finally

throw

3.

MULTIPLE SELECT QUESTION

45 sec • 1 pt

What is the purpose of 'throw' keyword?

To Raise an exception explicitly

To Raise an exception implicitly

To create user defined exceptions

To create custom exceptions

4.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Which of the following statements should be used to import Exception Class?

import java.io.*

import java.lang.*

import java.util.*

import java.lang.Exception.*

5.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Choose an exception if there's an attempt to divide number by zero...


int number = 89 / 0;

System.out.println("The answer is " + number);

ArithmeticException

NullPointerException

NumberFormatException

ArrayIndexOutOfBoundException

6.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

WHAT IS THE OUTPUT?

public class Foo

{

public static void main(String[] args)

{

try

{

return;

}

finally

{

System.out.println( "Finally" );

}

}

}

Finally

Compilation fails.

The code runs with no output

An exception is thrown at runtime.

7.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Which will contain the body of the thread in Java?

Start()

Run()

Main()

Execute()

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?

Discover more resources for Computers