MCQOPTIONS
Saved Bookmarks
This section includes 8 Mcqs, each offering curated multiple-choice questions to sharpen your Technical MCQs knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
The class from which the child class inherits is called (i) Child class (ii) Parent class (iii) Super class (iv) Base class |
| A. | Only (i) |
| B. | (ii), (iii) and (iv) |
| C. | Only (iii) |
| D. | (ii) and (iv) |
| E. | |
| Answer» E. | |
| 2. |
<?php class letsfindcourse{ public function __destruct(){ echo 'The class "' . __CLASS__ . '" was destroyed!'; } } $lfc = new letsfindcourse; ?>7.Which one of the following functions is used to determine whether a class exists? |
| A. | exist() |
| B. | exist_class() |
| C. | class_exist() |
| D. | __exist() |
| Answer» D. __exist() | |
| 3. |
<?php class letsfindcourse { public function __construct(){ echo 'The class "' . __CLASS__ . '" was initiated!<br>'; } } $lfc = new letsfindcourse; ?>6.Which of the following is the output of the below code? |
| A. | The class letsfindcourse was destroyed! |
| B. | The class lfc was initiated! |
| C. | Error |
| D. | No Output |
| Answer» B. The class lfc was initiated! | |
| 4. |
Which of the following is the output of the below code? |
| A. | The class letsfindcourse was initiated!<br> |
| B. | The class lfc was initiated!<br> |
| C. | Error |
| D. | No Output |
| Answer» B. The class lfc was initiated!<br> | |
| 5. |
We define our own class by starting with the keyword ______ ? |
| A. | class |
| B. | function |
| C. | auto |
| D. | var |
| Answer» B. function | |
| 6. |
What will be the syntax of defining the class? |
| A. | class lfc () |
| B. | class lfc [] |
| C. | class lfc {} |
| D. | lfc class{} |
| Answer» D. lfc class{} | |
| 7. |
Class is a programmer-defined data type, which includes _____ methods and ______ variable? |
| A. | local, global |
| B. | global, global |
| C. | global, local |
| D. | local, local |
| Answer» E. | |
| 8. |
Classes are the _______ of objects. |
| A. | type |
| B. | blueprints |
| C. | reference |
| D. | instances |
| Answer» C. reference | |