C#数据类型
来源:互联网 发布:web后端编程语言 编辑:程序博客网 时间:2024/05/18 03:22
先看简图:
C#中的运算符就有这些,简单介绍下C#中的赋值运算符。
class SimpleAssgningOP //定义类 { public int i; } class RefTestApp { public static void main() { SimpleAssgningOP test1 =new SimpleAssgningOP (); test1.i=1; SimpleAssgningOP test2=new SimpleAssgningOP() ; test2.i=2; Console.WriteLine ("Before object assignment"); Console .WriteLine ("test1.i={0}",test1.i); Console .WriteLine ("test2.i={0}",test2.i); test1=test2; Console .WriteLine ("After object assignment"); Console.WriteLine ("Before object assignment"); Console .WriteLine ("test1.i={0}",test1.i); Console .WriteLine ("test2.i={0}",test2.i); test1.i=150; Console .WriteLine ("After change to only test1 member"); Console .WriteLine ("test1.i={0}",test1.i); Console .WriteLine ("test2.i={0}",test2.i); } } } }运算结果:
Before object assignment
test1.i=1
test2.i=2
After object assignment
Before object assignment
test1.i=2
test2.i=2
After change to only test1 member
test1.i=150
test2.i=150
注意:虽然只是改变了test1的值,但test2的值也改变了。
- c#数据类型
- C#数据类型
- C# 数据类型
- C# 数据类型
- C#数据类型
- C# :数据类型
- C#数据类型
- C# 数据类型
- C#数据类型
- C#数据类型
- C# 数据类型
- c#数据类型
- C#数据类型
- C#数据类型
- C#数据类型
- C#数据类型
- C#数据类型
- C#数据类型
- (JAVA自学笔记)反射技术
- solr进阶: 如何定制搜索服务,扩展搜索逻辑
- JAVA对象克隆和序列化
- hdu1013 Digital Roots
- ls -l 第一行出现的total 计数
- C#数据类型
- 数码管
- HTTP头域列表与解释 之 response篇
- oracle培训记录
- VC中如何得到一个文件夹的路径
- gnuplot 入门教程 3
- Qt的相关Pointer(4)-------QSharedDataPointer
- lispbox在linux下的安装
- Linux 动态链接库(shared object)的基础知识