单选题:Suppose you have a class MyClass and want to easily replace the
Suppose you have a class MyClass and want to easily replace the contents of one object, target, with the contents of another object of MyClass, source. Which of the following statements would correctly create the copy?
@[C](2)
A. `target = source;`
B. `target.clone(source); `
C. `target = source.clone();`
D. `target = (MyClass) source.clone();`
A.`target = source;`
B.`target.clone(source); `
C.`target = source.clone();`
D.`target = (MyClass) source.clone();`
答案:C
@[C](2)
A. `target = source;`
B. `target.clone(source); `
C. `target = source.clone();`
D. `target = (MyClass) source.clone();`
A.`target = source;`
B.`target.clone(source); `
C.`target = source.clone();`
D.`target = (MyClass) source.clone();`
答案:C