Examveda
Examveda

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

A. _clone(targetObject);

B. destinationObject = clone targetObject;

C. destinationObject = _clone(targetObject);

D. destinationObject = clone(targetObject);

Answer: Option B

Solution(By Examveda Team)

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

This Question Belongs to PHP >> Object Oriented Concept

Join The Discussion

Related Questions on Object Oriented Concept