After Group Activity

After Group Activity

Professional Development

5 Qs

quiz-placeholder

Similar activities

Exception Handling-1

Exception Handling-1

Professional Development

10 Qs

PBD SK T4 - 1.2 Algoritma

PBD SK T4 - 1.2 Algoritma

1st Grade - Professional Development

6 Qs

Езикът Java - синтаксис

Езикът Java - синтаксис

KG - Professional Development

9 Qs

Arreglos Java

Arreglos Java

Professional Development

6 Qs

Java Strings

Java Strings

1st Grade - Professional Development

10 Qs

PreTrainingExceptions

PreTrainingExceptions

Professional Development

10 Qs

PreTrainingScannerLoops

PreTrainingScannerLoops

Professional Development

10 Qs

Java Strings and lops

Java Strings and lops

Professional Development

10 Qs

After Group Activity

After Group Activity

Assessment

Quiz

Computers

Professional Development

Medium

Created by

Ms STAFF

Used 1+ times

FREE Resource

5 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following Java code?

class Output {

public static void main(String args[]) {

try {

int a = 0;

int b = 5;

int c = a / b;

System.out.print("Hello");

} finally {

System.out.print("World");

}

}

}

Hello

World

HelloWorld

Compilation Error

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following exceptions is not a subclass of the RuntimeException class?

NullPointerException

ArrayIndexOutOfBoundsException

IOException

ArithmeticException

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following program?

public class Question {

public static void main(String[] args) {

try {

int a = 5 / 0;

}

catch (Exception e) {

catch (ArithmeticException a) {

System.out.println("Cannot divide by 0");

}

}

System.out.println("Hello World");

}

}

“Hello World”

“Cannot divide by 0”

Compilation Error

Runtime Error (the code compiles successfully)

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which exception is thrown when an array element is accessed beyond the array size?

ArrayElementOutOfBounds

ArrayIndexOutOfBoundsException

ArrayIndexOutOfBounds

None of these

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following program?

public class Question {

public static void main(String[] args) {

try {

int a = 5 / 0;

}

catch (Exception e) {

System.out.println("unknown exception");

}

catch (ArithmeticException a) {

System.out.println("Cannot divide by 0");

}

System.out.println("Hello World");

}

}

“Hello World”

“Cannot divide by 0”

Compilation Error

RuntimeError (the code compiles successfully)