Object-Oriented Programming Quiz

Object-Oriented Programming Quiz

Professional Development

40 Qs

quiz-placeholder

Similar activities

Introduction to ICT Quiz

Introduction to ICT Quiz

Professional Development

40 Qs

CCSE-5

CCSE-5

Professional Development

40 Qs

What is a Trojan? And Its Indications

What is a Trojan? And Its Indications

Professional Development

36 Qs

Programación Orientada a Objetos

Programación Orientada a Objetos

Professional Development

40 Qs

Quiz on Large Language Models and RAG

Quiz on Large Language Models and RAG

Professional Development

35 Qs

AWS VPC Peering Worksheet

AWS VPC Peering Worksheet

Professional Development

35 Qs

Information Management Prefinal Exam

Information Management Prefinal Exam

Professional Development

40 Qs

sql commands

sql commands

Professional Development

35 Qs

Object-Oriented Programming Quiz

Object-Oriented Programming Quiz

Assessment

Quiz

Information Technology (IT)

Professional Development

Practice Problem

Medium

Created by

Cecilio Salonoy

Used 2+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

40 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

What is the primary purpose of exceptions in PHP?

To improve performance

To handle errors and exceptional conditions

To create faster loops

To replace variables

2.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Which PHP keyword is used to define a block of code where exceptions may occur?

throw

catch

try

finally

3.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Which keyword is used to raise an exception in PHP?

raise

throw

error

catch

4.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

In the given example, what is the name of the custom exception class?

MyException

CustomException

UserException

DivisionException

5.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

What block of code is executed regardless of whether an exception is thrown or not?

try

throw

catch

finally

6.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Given the function: function divide($a, $b) { if ($b === 0) { throw new Exception("Division by zero."); } return $a / $b; } What happens when divide(4, 0) is called?

Returns 0

Throws an Exception

Prints "Division by zero."

Ignores the error

7.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

If an exception is thrown but no catch block is defined, what will happen?

The program ignores the exception

The program continues as normal

The program terminates with a fatal error

The program retries the block

Create a free account and access millions of resources

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?