+ 3
I didnt undstand x={0} e y ={1}
7 ответов
+ 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!
+ 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
+ 2
It is a parameter replacement. {0} is replaced with the contents of the first variable, etc.
0
They are variable placeholders. That is what the {0} and {1} stand for.
0
You can also do this:
string name = "Malachi";
int age = 24;
Console.WriteLine("My name is " + name + "and my age is " + age);
- 2
So we can put anything on the placeholder?
- 6
So basiscally int a IS EQUAL TO {0} int b === {1} etc etc