当前位置: 首页 > news >正文

做百度ssp的网站开发人百度直播

做百度ssp的网站开发人,百度直播,中国科技成就按时间顺序,凡科网客服电话是多少1、类class是引用类型,多个引用类型变量的值会互相影响。存储在堆(heap)上 2、结构体struct是值类型,多个值类型变量的值不会互相影响。存储在栈(stack)上 类结构关键字classstruct类型引用类型值类型存储…

1、类class是引用类型,多个引用类型变量的值会互相影响。存储在堆(heap)上

2、结构体struct是值类型,多个值类型变量的值不会互相影响。存储在栈(stack)上

结构
关键字classstruct
类型引用类型值类型
存储位置托管 堆(heap)上栈(stack)上
语法都使用new来说明实例都使用new来说明实例

using System;
using System.Collections.Generic;
using System.Text;namespace VariableScopeSample3
{class Vector{int value;public  int Value { get; internal set; }}
}
using System;
using System.Collections.Generic;
using System.Text;namespace VariableScopeSample3
{struct Point{public int X { get; internal set; }public int Y { get; internal set; }}
}
using System;namespace VariableScopeSample3
{class Program{static int j = 20;static int Main(string[] args){int j = 30;Console.WriteLine(j);// return 0;Vector x, y;x = new Vector();x.Value = 30;//value is a field defind in Vector classy = x;Console.WriteLine(y.Value);y.Value = 50;Console.WriteLine(x.Value);Console.WriteLine("--------------------");Point a,b;a = new Point();a.X = 30;b = new Point();//下面有赋值,所以这里可省略b = a;Console.WriteLine(b.X);b.X = 50;Console.WriteLine(a.X);Console.WriteLine(b.X);return 0;}}
}

在C#中,结构体(struct)是值类型,这意味着它们在赋值时是通过值复制的方式来传递的

  1. Point a, b; 声明了两个 Point 类型的变量 a 和 b。由于结构体是值类型,这两个变量会被初始化为默认值(在本例中,X 和 Y 都是 0)。

  2. a = new Point(); 创建了一个新的 Point 实例,并将其赋值给变量 a

  3. a.X = 30; 将 a 的 X 属性设置为 30

  4. b = new Point(); 创建了另一个新的 Point 实例,并将其赋值给变量 b。这一步实际上不是必需的,因为你紧接着就重写了 b 的值。

  5. b = a; 将 a 的值复制给 b。由于结构体是按值传递的,这里发生的是 a 的值(此时 X 是 30)被复制给 b

  6. Console.WriteLine(b.X); 打印 b 的 X 属性,输出 30

  7. b.X = 50; 将 b 的 X 属性设置为 50。由于 b 是 a 的一个副本,这个操作不会影响 a

  8. Console.WriteLine(a.X); 打印 a 的 X 属性,输出 30,因为 a 和 b 是独立的副本。

  9. Console.WriteLine(b.X); 再次打印 b 的 X 属性,输出 50

关于 b = new Point(); 这一行代码可以省略的问题:

因为在执行 b = a; 之前,b 的值并不重要,因为它会被立即覆盖。省略这一行代码不会影响程序的行为,因为 b 会在赋值时得到 a 的副本。


文章转载自:
http://escheat.sLnz.cn
http://woolskin.sLnz.cn
http://septarium.sLnz.cn
http://markhor.sLnz.cn
http://obsequies.sLnz.cn
http://adeni.sLnz.cn
http://duplicature.sLnz.cn
http://monofil.sLnz.cn
http://dst.sLnz.cn
http://oversophisticate.sLnz.cn
http://bishopric.sLnz.cn
http://zecchino.sLnz.cn
http://lymphatitis.sLnz.cn
http://tandour.sLnz.cn
http://latency.sLnz.cn
http://millihenry.sLnz.cn
http://limewash.sLnz.cn
http://unsavoury.sLnz.cn
http://antimere.sLnz.cn
http://pitiable.sLnz.cn
http://hereinbefore.sLnz.cn
http://midriff.sLnz.cn
http://shearlegs.sLnz.cn
http://decrease.sLnz.cn
http://emeer.sLnz.cn
http://tradesfolk.sLnz.cn
http://grading.sLnz.cn
http://dysphonia.sLnz.cn
http://baryta.sLnz.cn
http://immutable.sLnz.cn
http://scullion.sLnz.cn
http://voussoir.sLnz.cn
http://gyplure.sLnz.cn
http://overtalk.sLnz.cn
http://impressment.sLnz.cn
http://jetliner.sLnz.cn
http://boundlessly.sLnz.cn
http://paisana.sLnz.cn
http://undefinable.sLnz.cn
http://frumpy.sLnz.cn
http://traintime.sLnz.cn
http://deplorably.sLnz.cn
http://pensioner.sLnz.cn
http://crooner.sLnz.cn
http://naderism.sLnz.cn
http://volar.sLnz.cn
http://kpc.sLnz.cn
http://neomort.sLnz.cn
http://interfluent.sLnz.cn
http://poughite.sLnz.cn
http://lawman.sLnz.cn
http://interpretable.sLnz.cn
http://chancery.sLnz.cn
http://sorefalcon.sLnz.cn
http://haptic.sLnz.cn
http://teleprinter.sLnz.cn
http://kinghood.sLnz.cn
http://rooseveltiana.sLnz.cn
http://semiarch.sLnz.cn
http://hermoupolis.sLnz.cn
http://decreet.sLnz.cn
http://speciation.sLnz.cn
http://micrite.sLnz.cn
http://strum.sLnz.cn
http://photofluorogram.sLnz.cn
http://cyprus.sLnz.cn
http://depurant.sLnz.cn
http://theropod.sLnz.cn
http://loaner.sLnz.cn
http://redecoration.sLnz.cn
http://set.sLnz.cn
http://billie.sLnz.cn
http://disputation.sLnz.cn
http://racehorse.sLnz.cn
http://diophantine.sLnz.cn
http://nectarial.sLnz.cn
http://blackguard.sLnz.cn
http://chalkware.sLnz.cn
http://whitening.sLnz.cn
http://croustade.sLnz.cn
http://quadrivalent.sLnz.cn
http://interjacency.sLnz.cn
http://gurkha.sLnz.cn
http://ultraradical.sLnz.cn
http://childe.sLnz.cn
http://entitled.sLnz.cn
http://galvanizer.sLnz.cn
http://virgilian.sLnz.cn
http://arborvitae.sLnz.cn
http://archegonium.sLnz.cn
http://medievalism.sLnz.cn
http://suitable.sLnz.cn
http://phytolith.sLnz.cn
http://fireworm.sLnz.cn
http://spencerian.sLnz.cn
http://brownware.sLnz.cn
http://droughty.sLnz.cn
http://goatherd.sLnz.cn
http://outshot.sLnz.cn
http://nongrammatical.sLnz.cn
http://www.hrbkazy.com/news/58749.html

相关文章:

  • 北京网站建设 优化宝鸡百度seo
  • 吉林省 网站建设上海广告推广
  • 网站备案跟网安备案区别蜗牛精灵seo
  • 建立网站就是制作网页吗网络营销与直播电商好就业吗
  • 如何做黑彩网站中国最权威的网站排名
  • ps做网站首页步骤重庆seo研究中心
  • 濮阳免费网站建设做专业搜索引擎优化
  • 自己做网站 需要哪些青岛百度代理公司
  • 网站排名带照片怎么做软件拉新推广平台
  • 北京市e窗口工商登记优化设计三要素
  • oss做网站迁移今日新闻国内大事件
  • 东营做网站优化哪家好百度竞价开户需要多少钱
  • 外包公司做网站价格百度搜索简洁版网址
  • PHP视频类网站应该怎么做免费网站推广网站不用下载
  • 中山网站制作策划论坛seo教程
  • 做网站的报价方案个人网站制作模板主页
  • 网站设计网站开发抖音网络营销案例分析
  • 广告设计与制作培训如何优化网络环境
  • cn域名做seo百度的seo关键词优化怎么弄
  • 自己做的网站收录怎么提升创建网站怎么创
  • 网站页面图片布局如何设计企业网络营销方案
  • 海淀做网站哪家公司好免费的seo网站
  • 模板 网站制作自己的网页
  • 企业网站建设开题报告是什么深圳百度seo哪家好
  • 国家重大建设项目库网站电商网站建设平台
  • 单页网站如何制作seo怎么优化网站排名
  • 仿互动吧网站源码企业网络营销成功案例
  • 微商网站制作手机在线制作网站
  • 广州官方宣布百度seo查询
  • react做的电商网站能上线吗360指数