求个C#高手 帮我解决下这题如果解答三、写出下列程序执行结果class MainTest{ Static void Main(string[] args()){ Variable v = new Variable(); Console.WriteLine("x=" + v.x + " y=" + v.y + " z=" + v.z); v.Init(20,30) ; Console

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/11 15:45:17
求个C#高手 帮我解决下这题如果解答三、写出下列程序执行结果class MainTest{  Static void Main(string[] args()){ Variable  v = new Variable(); Console.WriteLine(

求个C#高手 帮我解决下这题如果解答三、写出下列程序执行结果class MainTest{ Static void Main(string[] args()){ Variable v = new Variable(); Console.WriteLine("x=" + v.x + " y=" + v.y + " z=" + v.z); v.Init(20,30) ; Console
求个C#高手 帮我解决下这题如果解答
三、写出下列程序执行结果class MainTest{ Static void Main(string[] args()){ Variable v = new Variable(); Console.WriteLine("x=" + v.x + " y=" + v.y + " z=" + v.z); v.Init(20,30) ; Console.WriteLine("x=" + v.x + " y=" + v.y + " z=" + v.z);}}Class Variable{ public int x = 0, y = 0, z = 0 ; public void Init(int x,int y) { this.x = x; this.y=y; int z=5;Console.WriteLine("x="+x+" y="+y+" z="+z)}}

求个C#高手 帮我解决下这题如果解答三、写出下列程序执行结果class MainTest{ Static void Main(string[] args()){ Variable v = new Variable(); Console.WriteLine("x=" + v.x + " y=" + v.y + " z=" + v.z); v.Init(20,30) ; Console
x=0 y=0 z=0
x=20 y=30 z=5
x=20 y=30 z=0
代码没有区分大小写,好好检查一下,不然没办法运行的