MCQ Single Best Answer Not Set

QWhich one of the following is the right way to clone an object?

ID: #2584 Object Oriented Concept of PHP 1,926 views
Question Info
#2584Q ID
Not SetDifficulty
Object Oriented Concept of PHPTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A _clone(targetObject);
  • B destinationObject = clone targetObject;
  • C destinationObject = _clone(targetObject);
  • D destinationObject = clone(targetObject);
Correct Answer: Option B

Explanation

You can clone an object by prefacing it with the clone keyword.

Share This Question

Challenge a friend or share with your study group.