CSharp · Console
using System;
public class Program
{
public static void Main()
{
string s1 = "строка";
System.Text.StringBuilder sb = new
System.Text.StringBuilder(s1);
System.Console.WriteLine(sb);
string s2 = sb.ToString();
OpTest<string>(s1, s2);
OpTest2<string>(s1, s2);
}
public static void OpTest<T>(T s, T t) where T : class {
System.Console.WriteLine(s == t);
}
public static void OpTest2<T>(T s, T t) where T : class {
System.Console.WriteLine(s.Equals(t));
}
}