Question49.(单选)
三种常用的字符串判空串方法:
1:boolisEmpty=(str.Length==0);
2:boolisEmpty=(str==String.Empty);
3:boolisEmpty=(str=="");
哪种方法最快?1
1.1
2.2
3.3
Question50.(单选)
publicsealedclassSampleSingleton1
{
privateintm_Counter=0;
privateSampleSingleton1()
{
Console.WriteLine(""初始化SampleSingleton1。"");
}
publicstaticreadonlySampleSingleton1Singleton=newSampleSingleton1();
publicvoidCounter()
{
m_Counter++;
}
}
以上代码实现了设计模式中的哪种模式?3
1.原型
2.抽象工厂
3.单键
4.生成器