Java-QUIZ-PSGRK

Java-QUIZ-PSGRK

University

15 Qs

quiz-placeholder

Similar activities

JAVA QUIZ-1

JAVA QUIZ-1

University

10 Qs

MIT App Inventor

MIT App Inventor

University

10 Qs

Programming Standard Input

Programming Standard Input

University

10 Qs

IF Pagi - Quiz 2

IF Pagi - Quiz 2

University

20 Qs

Java Quiz1

Java Quiz1

University

10 Qs

Java Exception Handling

Java Exception Handling

University

15 Qs

JRB2 Quiz 4

JRB2 Quiz 4

University

10 Qs

MS Core Java Quiz-2 2023

MS Core Java Quiz-2 2023

University

12 Qs

Java-QUIZ-PSGRK

Java-QUIZ-PSGRK

Assessment

Quiz

Computers

University

Hard

Created by

saranya pravin

Used 1+ times

FREE Resource

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()

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?