Given:
What is the result?
Given:
What is the result?
A
i don´t think the right answer is given here...i go for ACCD
Correct, Answer is A. To test: public static void main(String[] args) { String ta = "A "; ta = ta.concat("B "); String tb = "C "; ta = ta.concat(tb); ta.replace("B" ,"C"); ta = ta.concat("D"); System.out.println(ta); }
public class Test { public static void main(String[] args) { String ta = "A "; System.out.println(ta); ta = ta.concat("B "); System.out.println(ta); String tb = "C "; ta = ta.concat(tb); System.out.println(ta); ta.replace("B" ,"C"); System.out.println(ta); ta = ta.concat("D"); System.out.println(ta); } try this if wanna understand more on this
public class Test { public static void main(String[] args) { String ta = "A "; System.out.println(ta); ta = ta.concat("B "); System.out.println(ta); String tb = "C "; ta = ta.concat(tb); System.out.println(ta); ta.replace("B" ,"C"); System.out.println(ta); ta = ta.concat("D"); System.out.println(ta); } try this if wanna understand more on this
A. A B C D
ABCC is the correct!