

MCQOPTIONS
Saved Bookmarks
This section includes 411 Mcqs, each offering curated multiple-choice questions to sharpen your Technical Programming knowledge and support exam preparation. Choose a topic below to get started.
51. |
Which one of the following keyword is used to implement an interface? |
A. | interface |
B. | get |
C. | inherit |
D. | implements |
Answer» E. | |
52. |
At least how many abstract methods must an abstract class contain? |
A. | None |
B. | One |
C. | Two |
D. | Five |
Answer» C. Two | |
53. |
Which one of the following is the correct abstract method? |
A. | public function write() |
B. | abstract function write() |
C. | abstract public write(); |
D. | abstract public function write(); |
Answer» E. | |
54. |
Which one of the following keywords is used to define an abstract class? |
A. | extends |
B. | implements |
C. | abstract |
D. | new |
Answer» D. new | |
55. |
Which one of the following class can not be instantiated? |
A. | inherited class |
B. | abstract class |
C. | constant class |
D. | every class |
Answer» C. constant class | |
56. |
How many of the following can be contained in constants? i) boolean ii) integer iii) float iv) string |
A. | 1 |
B. | 2 |
C. | 3 |
D. | 4 |
Answer» E. | |
57. |
What will happen if you try to set a value to a constant once it has been declared? |
A. | The value of the variable will change |
B. | The value of the variable will not change |
C. | Parse Error |
D. | Nothing |
Answer» D. Nothing | |
58. |
Which one of the following is a constant variable? |
A. | const $name |
B. | const $NAME |
C. | constant NAME |
D. | const NAME |
Answer» E. | |
59. |
Which keyword is used to declare a constant property? |
A. | const |
B. | con |
C. | constant |
D. | _constant |
Answer» B. con | |
60. |
Which version of PHP allows you to define constant properties within a class? |
A. | PHP 4 |
B. | PHP 4.1 |
C. | PHP 4.3 |
D. | PHP 5 |
Answer» E. | |
61. |
What is the full form of PDO in Web/PHP? |
A. | PHP Data Orientation |
B. | PHP Database Object |
C. | PHP Database Orientation |
D. | PHP Data Object |
Answer» E. | |
62. |
Which one of the following variable cannot be used inside a static method? |
A. | $this |
B. | $get |
C. | $set |
D. | $date |
Answer» B. $get | |
63. |
In which of the following circumstance should you use a static reference to a non static method? |
A. | Making a method call using parent |
B. | Making a method call using child |
C. | Making an object call using parent |
D. | Making an object call using child |
Answer» B. Making a method call using child | |
64. |
Which keyword is used to access a static method or property from within the same class(rather than from child)? |
A. | static |
B. | strat |
C. | self |
D. | set |
Answer» D. set | |
65. |
Which version of PHP introduced the static keyword? |
A. | PHP 4 |
B. | PHP 5 |
C. | PHP 5.2 |
D. | PHP 5.3 |
Answer» C. PHP 5.2 | |
66. |
Which one of the following is true about the following line – $obj = new ImageHandler(‘/images/’, array(400, 300)); |
A. | This snippet sets the maximum dimensions allowed to 400 pixels wide by 300 pixels high |
B. | This snippet sets the minimum dimensions allowed to 300 pixels wide by 400 pixels high |
C. | This snippet sets the minimum dimensions allowed to 400 pixels wide by 300 pixels high |
D. | This snippet sets the maximum dimensions allowed to 300 pixels wide by 400 pixels high |
Answer» B. This snippet sets the minimum dimensions allowed to 300 pixels wide by 400 pixels high | |
67. |
Which function do you have to use to check whether the $path you’ve stored exists? |
A. | path_dir() |
B. | path() |
C. | is_dir() |
D. | path_dir() |
Answer» D. path_dir() | |
68. |
Before you try to process the file, you need to make sure that your $err value is equivalent to _________ |
A. | UPLOAD_ERR_OK |
B. | UPLOAD_NO_ERR |
C. | UPLOAD_ERR_NO_OK |
D. | UPLOAD_ERR |
Answer» B. UPLOAD_NO_ERR | |
69. |
To process the file, you need to break the array from $_FILES into individual values. You can do this using the ________ function. |
A. | divide() |
B. | list() |
C. | break() |
D. | indi() |
Answer» C. break() | |
70. |
DocBlocks are indicated by opening a comment using _________ |
A. | /* |
B. | //* |
C. | /** |
D. | /*/ |
Answer» D. /*/ | |
71. |
To make the ImageHandler class portable you should create a separate file for it called __________ |
A. | imagehandler.inc.php |
B. | images.inc.php |
C. | handler.inc.php |
D. | imghandler.inc.php |
Answer» C. handler.inc.php | |
72. |
To check whether a file was uploaded, you look in the _______ superglobal array. |
A. | $_FILES |
B. | $_DOCS |
C. | $_DOCUMENTS |
D. | $_FOLDERS |
Answer» B. $_DOCS | |
73. |
When you’re uploading files you need to set the enctype of the form to __________ |
A. | text |
B. | text/file |
C. | multipart/form-data |
D. | multimedia/form-data |
Answer» D. multimedia/form-data | |
74. |
Before you can start processing images with PHP, you must first add the ability to upload images to your administrative form on ________ |
A. | .htaccess |
B. | function.inc.php |
C. | index.php |
D. | admin.php |
Answer» E. | |
75. |
When a user confirms that he wishes to delete an entry, that entry’s URL is passed to a function which removes the entry from the __________ |
A. | index.php |
B. | function.inc.php |
C. | database |
D. | admin.php |
Answer» D. admin.php | |
76. |
Your confirmation form submits your choice, via the _______ method, to ________ |
A. | GET index.php |
B. | GET admin.php |
C. | POST index.php |
D. | POST admin.php |
Answer» E. | |
77. |
To declare the function to confirm the deletion you need to add the code to __________ |
A. | inc.php |
B. | functions.inc.php |
C. | include.php |
D. | functions.include.php |
Answer» C. include.php | |
78. |
To identify entries marked for deletion, you check whether $_GET[‘page’] == ‘delete’ inside __________ |
A. | index.php |
B. | index.ini |
C. | admin.php |
D. | .htaccess |
Answer» D. .htaccess | |
79. |
You need to check whether ______ is set, to determine whether you’re editing an entry or creating a new one. |
A. | $_GET[‘url’]. |
B. | $_SET[‘url’]. |
C. | $_GET[‘admin’]. |
D. | $_SET[‘admin’]. |
Answer» B. $_SET[‘url’]. | |
80. |
([\w-]+) will match ___________ |
A. | one word characters |
B. | one or more word characters |
C. | one or more word characters and/or hyphens |
D. | one or more word characters and hyphens |
Answer» D. one or more word characters and hyphens | |
81. |
The (|/) tells the server to match ___________ |
A. | nothing |
B. | forward slash |
C. | backward slash |
D. | either nothing or a forward slash |
Answer» E. | |
82. |
The URLs in the administrative links won’t mean anything to admin.php unless you modify _________ |
A. | .htaccess |
B. | .adminaccess |
C. | .htmlaccess |
D. | .urlaccess |
Answer» B. .adminaccess | |
83. |
Once your application can generate administrative links, you need to load those links into _______ |
A. | php.ini |
B. | index.ini |
C. | index.php |
D. | start.php |
Answer» D. start.php | |
84. |
When you are building administrative links you’ll need to accept two arguments, which of the following are they? |
A. | URL of previous entry and URL of the entry you are working with |
B. | The current page and previous page |
C. | URL of previous entry and previous page |
D. | The current page and URL of the entry you are working with |
Answer» E. | |
85. |
A mutator method is also called as.. |
A. | Setter |
B. | Accessor |
C. | Getter |
D. | Destructor |
Answer» B. Accessor | |
86. |
Which method or property can only be accessed from within the enclosing class? Even subclasses have no access. |
A. | public |
B. | friendly |
C. | private |
D. | protected |
Answer» D. protected | |
87. |
Prior to which version of PHP did constructors took the name of the enclosing class. |
A. | PHP 4 |
B. | PHP 5 |
C. | PHP 5.3 |
D. | PHP 5.4 |
Answer» C. PHP 5.3 | |
88. |
What should be used to refer to a method in the context of a class rather than an object you use? |
A. | -> |
B. | __ |
C. | $ |
D. | :: |
Answer» E. | |
89. |
Inheritance is the means by which one or more classes can be derived from a/an ___ class. |
A. | base |
B. | abstract |
C. | null |
D. | predefined |
Answer» B. abstract | |
90. |
Which version of PHP introduced class type hints? |
A. | PHP 4 |
B. | PHP 4.3 |
C. | PHP 5 |
D. | PHP 5.3 |
Answer» D. PHP 5.3 | |
91. |
Which function is used to determine whether the variable’s value is either TRUE or FALSE? |
A. | boolean() |
B. | is_boolean() |
C. | bool() |
D. | is_bool() |
Answer» E. | |
92. |
If you omit the visibility keyword in your method declaration, by default the method will be declared as.. |
A. | public |
B. | private |
C. | protected |
D. | friendly |
Answer» B. private | |
93. |
Which keyword precedes a method name? |
A. | method |
B. | function |
C. | public |
D. | protected |
Answer» C. public | |
94. |
Code that uses a class, function, or method is often described as the.. |
A. | client code |
B. | user code |
C. | object code |
D. | class code |
Answer» B. user code | |
95. |
Which characters is used to access property variables on an object-by-object basis? |
A. | :: |
B. | = |
C. | -> |
D. | . |
Answer» D. . | |
96. |
Which version of PHP introduced the visibility keywords i.e public, private, and protected? |
A. | PHP 4 |
B. | PHP 5 |
C. | PHP 5.1 |
D. | PHP 5.3 |
Answer» C. PHP 5.1 | |
97. |
There are two objects- $product1 = new Shop(); $product2 = new Shop(); Which one of the following statements is right about them? |
A. | $product1 and $product2 are same objects of the same type generated from a single class. |
B. | $product1 and $product2 are different objects of the same type generated from a single class. |
C. | $product1 and $product2 are same objects of the different type generated from a single class. |
D. | $product1 and $product2 are different objects of the different type generated from a single class. |
Answer» C. $product1 and $product2 are same objects of the different type generated from a single class. | |
98. |
Fill in the blank with the best option. An Object is a/an ________ of a class. |
A. | type |
B. | prototype |
C. | instance |
D. | object |
Answer» D. object | |
99. |
Which one of the following is not a valid class name? |
A. | ShopProduct |
B. | Shopproduct |
C. | Shopproduct1 |
D. | 1shopproduct |
Answer» E. | |
100. |
Which method rolls back the present transaction? |
A. | commit() |
B. | undo() |
C. | back() |
D. | rollback() |
Answer» E. | |