ÑÅ»¢¹«Ë¾C#±ÊÊÔÌâ(2)(¶þ)

2014-11-23 20:29:04 ¡¤ ×÷Õß: ¡¤ ä¯ÀÀ: 41
ompiler offers compile time checking for backward compatibility.
4. It doesn¡¯t.


Question 49. (µ¥Ñ¡)


ÈýÖÖ³£ÓõÄ×Ö·û´®Åпմ®·½·¨£º


1: bool isEmpty = (str.Length == 0);
2: bool isEmpty = (str == String.Empty);
3: bool isEmpty = (str == ¡°¡±);


ÄÄÖÖ·½·¨×î¿ì£¿


1. 1
2. 2
3. 3


Question 50. (µ¥Ñ¡)


public sealed class SampleSingleton1
{
private int m_Counter = 0;
private SampleSingleton1()
{
Console.WriteLine(¡°¡±³õʼ»¯SampleSingleton1¡£¡±");
}


public static readonly SampleSingleton1 Singleton = new SampleSingleton1();


public void Counter()
{
m_Counter ++;
}
}


ÒÔÉÏ´úÂëʵÏÖÁËÉè¼ÆÄ£Ê½ÖеÄÄÄÖÖģʽ£¿


1. Ô­ÐÍ
2. ³éÏ󹤳§
3. µ¥¼ü
4. Éú³ÉÆ÷