I want to print the two integer variables divided.
int a = 1, b = 2;
System.out.println(a + b);
Obviously println() function processes them as integers and calculates the sum. Instead I would like the output becomes like this "12". Any ideas?
I want to print the two integer variables divided.
int a = 1, b = 2;
System.out.println(a + b);
Obviously println() function processes them as integers and calculates the sum. Instead I would like the output becomes like this "12". Any ideas?
Insert some blank Strings to induce this:
System.out.println(a +""+ b);
Store the integers as strings:
String a = "1";
String b = "2";
String c = a + b;
System.out.println(c);