What will be in strName after the following code is executed? [code] strName=”Joanne Hashen” strName=strName.Insert(7,”C.”); [/code]

Thành Nguyễn

New member
What will be in strName after the following code is executed?
Code:
strName=”Joanne Hashen”
strName=strName.Insert(7,”C.”);
A. Joanne C. Hashen
B. JoanneC.hashen
C. Joanne
D. C.Hashen
 
Answer: A
Explanation: The code assigns the string “Joanne C. Hashen” to the variable strName. The string “C.” is inserted in between at position 7, and it is inserted in the variable which contained the original String. Thus the original String will change, if no copy of the original String is changed.
 

Tìm kiếm

Back
Top