+ 3

I didnt undstand x={0} e y ={1}

6th Apr 2016, 3:26 AM
Marciel Rodrigues
7 Réponses
+ 22
They are placeholders for the variables, see example below. string name = "Malachi"; int age = 24; Console.WriteLine("My name is {0}, and my age is {1}", name, age); This will result in; My name is Malachi, and my age is 24 {0} is replaced with the variable called "name" {1} is replaced with the variable called "age" Hope this helps!
18th Apr 2016, 5:26 PM
Malachi Jones
Malachi Jones - avatar
+ 4
int x=10 is OK but if we use int y=20 instead and using double ,is there is any problem? if we use int it is 1cycles/ executions so time consumption is also less
26th Jan 2017, 7:28 PM
ADITYA AVADHANI M.L
ADITYA AVADHANI M.L - avatar
+ 2
It is a parameter replacement. {0} is replaced with the contents of the first variable, etc.
5th May 2016, 2:07 PM
David Nurbin
0
They are variable placeholders. That is what the {0} and {1} stand for.
15th Apr 2016, 8:49 PM
Andre Davis
Andre Davis - avatar
0
You can also do this: string name = "Malachi"; int age = 24; Console.WriteLine("My name is " + name + "and my age is " + age);
6th Nov 2016, 8:14 AM
rngt
- 2
So we can put anything on the placeholder?
22nd Nov 2016, 5:54 AM
Galang
- 6
So basiscally int a IS EQUAL TO {0} int b === {1} etc etc
18th Jul 2016, 11:24 AM
Henry