Object Oriented Concept - Study Mode
[#131] Which one of the following is the right way to clone an object?
Correct Answer
(B) destinationObject = clone targetObject
Explanation
Solution: You can clone an object by prefacing it with the clone keyword.
[#132] What is the value of message? $name = “John”
$message = ‘Hello, $name’
Correct Answer
(C) ‘Hello, $name’
[#133] The result of below statements will be: $str = ""Hello fri3nd, you're
feeling happy today?”
echo str_word_count ( $str )
Correct Answer
(A) 7
[#134] Which one of the following is the right way to define a constant?
Correct Answer
(D) const PI = ‘3.1415’
Explanation
Solution: Class constants are created like: const NAME = ‘VALUE’
[#135] Which one of the following is the right way to call a class constant, given that the class is mathFunction?
Correct Answer
(C) echo mathFunction::PI