class struct Equals
2024-10-21 02:08:17
{
class clsA
{
private int _i;
public int I
{
set { _i = value; }
get { return _i; }
}
} struct strctB
{
private int _i;
public int I
{
set { _i = value; }
get { return _i; }
}
} class Program
{
static void Main1(string[] args)
{
clsA a1=new clsA();
a1.I=;
clsA a2=a1;
a2.I=;
Console.WriteLine("{0},{1}", a1.I, a2.I);//2,2
strctB b1=new strctB();
b1.I = ;
strctB b2=b1;
b2.I = ;
Console.WriteLine("{0},{1}", b1.I, b2.I);//1,2
}
static void Main(string[] args)
{
clsA a1 = new clsA();
a1.I = ;
clsA a2 = new clsA();
a2.I = ;
Console.WriteLine("{0}", a1.Equals(a2));//False
strctB b1 = new strctB();
b1.I = ;
strctB b2 = new strctB();
b2.I = ;
Console.WriteLine("{0}", b1.Equals(b2));//True
}
}
}
最新文章
- Netty系列之Netty百万级推送服务设计要点
- Android 多媒体播放API简介
- 解决pydev无法增加jython271 interpreter的问题
- 解决Only a type can be imported. com.mysql.jdbc.Connection resolves to a package的报错问题
- HTML解析类 ,让你不使用正则也能轻松获取HTML相关元素 -C# .NET
- Codeforces Round #149 (Div. 2)
- 7 天玩转 ASP.NET MVC — 第 5 天
- 把mvc4彻底搞定(一)
- 安装Visual Studio 2010时提示";The location specified for the help content store is invalid or you do not have access to it";.
- hdu1285+hdu2467(拓扑排序)
- codeforces 6A. Triangle
- EF 关联数据查询
- java_反射
- 博客编辑器Open Live Writer的安装以及配置
- WPF中任务栏只显示主窗口
- .10-浅析webpack源码之graceful-fs模块
- Eclipse安装Markdown插件
- mysql 单表查询
- MQ5.3在redhat9上的安装
- PHP 杂项函数