As we know
Java '+' operator is used for both
- Arithmetic Add
- String concatenation
Need to know exactly expected behavior and applied rule when i used both together
When i try following java code
System.out.println("3" + 3 + 3); // print 333 String concatenation ONLY
System.out.println(3 + "3" + 3); // print 333 String concatenation OLNY
System.out.println(3 + 3 + "3"); // print 63 Arithmetic Add & String concatenation