See the below code snippet:
int count = 0;
String query = "getQuery";
String query1 = "getQuery";
final String PARAMETER = "param";
query += "&" + PARAMETER + "=" + String.valueOf(count);
query1 += "&" + PARAMETER + "=" + count;
System.out.println("Cast to String=>"+query);
System.out.println("Without casting=>"+query1);
Got the both output exactly same. So I am wondering why this has been used when we can get the same result by using only count
.
I got some link but did not found exactly same confusion.