首页 > 学院 > 开发设计 > 正文

引用类型剖析

2019-11-11 05:44:28
字体:
来源:转载
供稿:网友
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace 引用类型剖析{    class PRogram    {        static void Main(string[] args)        {            int[] infozhang = new int[] { 170, 60 };            int[] infoli = new int[2];            Console.WriteLine("复制前--李明身高为:" + infoli[0] + "体重是:" + infoli[1]);            for (int i = 0; i < infozhang.Length; i++)            {                infoli[i] = infozhang[i];            }            Console.WriteLine("去年--张浩身高为:" + infozhang[0] + "体重是:" + infozhang[1] + ",李明身高为:" + infoli[0] + "体重是:" + infoli[1]);            infoli[0] = 178;            infoli[1] = 70;            Console.WriteLine("今年--张浩身高为:" + infozhang[0] + "体重是:" + infozhang[1] + ",李明身高为:" + infoli[0] + "体重是:" + infoli[1]);            Console.ReadLine();        }    }}
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表