What is the result? 10/29/2018 – by Mod_GuideK 3 Given: What is the result? A. A B C D B. A C D C. A B C C D. A B D E. A B D C SHOW ANSWERSCorrect Answer: E Explanation/Reference: Explanation/Reference: Download Printable PDF. VALID exam to help you PASS.
public static void main(String[] args) { String ta=”A”; ta= ta.concat(“B”); String tb = “C”; ta=ta.concat(tb); ta.replace(“C”,”D”);//not change because without assigned to (ta = ) ta=ta.concat(tb); System.out.println(ta);//ABCC } 2 Reply
public static void main(String[] args) {
String ta=”A”;
ta= ta.concat(“B”);
String tb = “C”;
ta=ta.concat(tb);
ta.replace(“C”,”D”);//not change because without assigned to (ta = )
ta=ta.concat(tb);
System.out.println(ta);//ABCC
}
Correct answer is C. “replace” is not assigned to ta so there is no change.
Answer is C