0
Why we add zero on console.write("hello{0}")
2 Answers
0
You need the braces and the number, when you have an optional argument to substitute this {0} with an Integer, character, Double, etc.
Else it is not required.
The number indicates the argument to substitute into, and the numbering starts from 0. Eg :
Integer age = 17;
String name = "Guy1";
Console.Write("{0} is {1} years old.", name, age);