What will be the output of below program? public class Test { public static void main() { String x = "abc"; String y = "abc"; x.concat(y); System.out.print(x); } }
Answers
Answered by
1
Answer:
abc
Explanation:
x.concat(y); will create a new string but it’s not assigned to x, so the value of x is not changed.
Similar questions