class1.cs
来自「C#开发教程 由浅入深 配有实例 是初学者的好帮手」· CS 代码 · 共 33 行
CS
33 行
using System;
namespace StringInterning
{
class StringInterningApp
{
public class Thing
{
private int i;
public Thing(int i) { this.i = i; }
}
[STAThread]
static void Main(string[] args)
{
Thing t1 = new Thing(123);
Thing t2 = new Thing(123);
Console.WriteLine(t1 == t2); // False
string a = "Hello";
string b = "Hello";
Console.WriteLine(a == b); // True
string c = String.Copy(a);
Console.WriteLine(a == c); // True
Console.WriteLine((object)a == (object)c); // False
Console.WriteLine((object)a == (object)b); // True
}
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?