zoukankan      html  css  js  c++  java
  • Equals 和==

    class Person
        {
            private string name;
            public string Name
            {
                get { return name; }
                set { name = value; }
            }
            public Person(string name)
            {
                this.name = name;
            }
        }
        class Program
        {
            static void Main(string[] args)
            {
                string a = new string(new char[] { 'h''e''l''l''o' });
                string b = new string(new char[] { 'h''e''l''l''o' });
                Console.WriteLine(a == b);
                Console.WriteLine(a.Equals(b));
                object g = a;
                object h = b;
                Console.WriteLine(g == h);
                Console.WriteLine(g.Equals(h));
     
                Person p1 = new Person("jia");
                Person p2 = new Person("jia");
                Console.WriteLine(p1 == p2);
                Console.WriteLine(p1.Equals(p2));
                Person p3 = new Person("jia");
                Person p4 = p3;
                Console.WriteLine(p3 == p4);
                Console.WriteLine(p3.Equals(p4));
                Console.ReadLine();
            }
        }
    http://zhidao.baidu.com/question/131846375.html
  • 相关阅读:
    keepalived安装
    Nginx学习笔记
    使用xhprof分析php性能
    使用 .bash_profile与.bashrc修改字符集
    Mysql分区简述
    c语言多线程队列读写
    setsockopt 设置 SO_LINGER 选项
    nginx配置rewrite
    使用PHP+ajax打造聊天室应用
    UDP/TCP通信小记
  • 原文地址:https://www.cnblogs.com/bingguang/p/3167649.html
Copyright © 2011-2022 走看看