ch1_04.cs

来自「《c#技术内幕代码》」· CS 代码 · 共 26 行

CS
26
字号
using System;

class CH1_4 {
	// Class level x variable
   static int x = 10;

   public static void Main() 
   {
	// Locally defined copy of x
	int x = 5;
	int   y = x;
	double z = y + 10.25;
	
	int a = (int)z;

	// Output X. Which one gets written?
	Console.WriteLine("X = {0} Y = {1} Z = {2}", x, y, z);
	Console.WriteLine("A = {0}", a);

	// Force the output of the class level x variable
	Console.WriteLine("Class Level X = {0}", CH1_4.x);
   }
}


⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?