Confusion regarding order of the x and y value? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Confusion regarding order of the x and y value?

static void Main(string[] args) { int x = 10; double y = 20; Console.WriteLine("x = {0}; y = {1}", x, y); } // Output: x = 10; y = 20 in the above programme can we change the value of x to 1 and vice versa if not then why?

1st Apr 2017, 4:09 PM
Rakesh Chandra Dash
Rakesh Chandra Dash - avatar
1 Answer
+ 9
we cannot change values because your method is static. it means it is declared as constant.
1st Apr 2017, 6:58 PM
Ajay Agrawal
Ajay Agrawal - avatar