DISCLOSURE:
A number is the outcome of adding two numbers:
int x = 10;
int y = 20;
int z = x + y; // z will be 30 (an integer/number)
A string concatenation is produced when two strings are added:
String x = "10";
String y = "20";
String z = x + y; // z will be 1020 (a String)
A string concatenation is what happens when you add a number and a string together:
String x = "10";
int y = 20;
String z = x + y; // z will be 1020 (a String)
CodingAsk.com is designed for learning and practice. Examples may be made simpler to aid understanding. Tutorials, references, and examples are regularly checked for mistakes, but we cannot guarantee complete accuracy. By using CodingAsk.com, you agree to our terms of use, cookie, and privacy policy.
Copyright 2010-2024 by Refsnes Data. All Rights Reserved.