I am aware of String concatenation: concat() vs "+" operator
But i have question on usage of both concat() and + operator effectively
concat()
is more efficient than +
operator but still we are using +
operator in few cases below
Case 1
System.out.println("Hi! Welcome: "+nameString);
Case 2:
splitting huge length line in to multiple lines(eclipse formatting)
System.out.println("Hi! Welcome: "+nameString1
+nameString2
+nameString3);
why still we are using +
operator instead of concat()
?