if (Object.ReferenceEquals(str1,str2))
来源:互联网 发布:jsp 视频网站源码 编辑:程序博客网 时间:2024/05/02 16:09
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication9
{
class Program
{
static void Main(string[] args)
{
Program a = new Program();
Program b = new Program();
if (a.Equals(b))
{
Console.WriteLine("a=b");
}
Console.WriteLine("a:{0}", a.GetHashCode());
Console.WriteLine("b:{0}", b.GetHashCode());
Program c = a;
if (a.Equals(c))
{
Console.WriteLine("a=c");
}
String str1 = new String("Hello".ToCharArray());
String str2 = new String("Hello".ToCharArray());
if (str1.Equals(str2))
{
Console.WriteLine("str1=str2");
}
if (str1==str2)
{
Console.WriteLine("str1=str2");
}
Console.WriteLine("str1:{0}", str1.GetHashCode());
Console.WriteLine("str2:{0}", str2.GetHashCode());
if (Object.ReferenceEquals(str1,str2))
{
Console.WriteLine("Object.ReferenceEquals(str1,str2)");
}
else
{
Console.WriteLine("Object.Reference not Equals(str1,str2)");
}
}
}
}
/*
a:46104728
b:12289376
a=c
str1=str2
str1=str2
str1:-694847
str2:-694847
Object.Reference not Equals(str1,str2)
请按任意键继续. . .
*/
- if (Object.ReferenceEquals(str1,str2))
- memcpy(str2,str1,i);
- 复制str1到str2
- strcpy(str1,str2);
- locate(str1,str2)函数
- str1==str2和str1.equals(str2)的问题
- Object.ReferenceEquals 方法
- object.ReferenceEquals 方法
- function return_value=EndWith(str1,str2)
- mysql 中的字符串连接 CONCAT(str1,str2,...)
- 16-1.5 str1 str2字符串连接
- 复制字符str1,保存到str2中
- 复制字符串str1,保存到str2中
- 复制字符串str1,保存在str2中
- 将字符串str1复制为字符串str2
- 判断字符串str1是否包含str2
- strstr(str1,str2)函数使用时注意事项
- 算法21:实现strstr(str1, str2)
- Python3数据结构【列表list,元组tuple,集合set】
- 2016 ThoughtWorks 校招编程作业
- 【SQL Server】数据操作语言——嵌套子查询
- Hadoop 日志分析
- 华为手机和谷歌原生系统虚拟按键遮挡布局问题
- if (Object.ReferenceEquals(str1,str2))
- pandas io tools(使用python处理数据时候经常用到)读csv,TXT
- 认识高斯分布
- JavaScript设计模式都有哪些?
- Bootstrap Table
- 牛客网刷题之最小的K个数
- BZOJ4385 POI2015 Wilcze doły
- Android中logcat的介绍和使用
- 图片延迟加载方案