我从.NET和C#的世界中为您选择了一些有趣但不是非常知名的问题。另外,我根据自己喜欢的书籍,文章和视频自己写了一些问题。1.屏幕上将显示什么?(如果什么都没有显示)string nullString = (string)null;
Console.WriteLine (nullString is string);
2.控制台.NET应用程序将显示什么?Console.WriteLine (Math.Round(1.5));
Console.WriteLine (Math.Round(2.5));
3.执行以下代码将导致什么结果:static void Main(string[] args)
{
float f = Sum(0.1f, 0.2f);
float g = Sum(0.1f, 0.2f);
Console.WriteLine(f == g);
}
static float Sum(float f1, float f2)
{
return f1 + f2;
}
a)正确b)错误c)将引发异常d)不能明确地说(很可能是正确的,但也可能是错误的)4.执行以下代码将导致什么结果:float price = 4.99F;
int quantity = 17;
float total = price * quantity;
Console.WriteLine("The total price is ${0}.", total);
a)总价为$ 85b)总价为$ 84.83c)总价为$ 84d)总价为$ 84.829995.在数据库中存储密码的最佳方法是什么?选择一个或多个答案:a)为纯文本b)使用DES加密c)使用AES加密d)使用MD5缓存e)使用SHA512缓存回答e
MD5 .
, keyed hash : HMACSHA1 MACTripleDES
6.在.NET环境中,有许多不同的计时器。哪个计时器不存在?a)来自System.Windows.Forms的计时器b)来自System.Windows.Threading的DispatchTimerc)来自Windows.UI.XAML的DispatchTimerd)来自System.Timers的计时器e)来自System.Windows.Threading.Timers的计时器f)来自系统的计时器。穿线回答e
Credits: CLR via C# Jeffrey Richter
7.网络上不存在什么.NET REPL?a)dotnetfiddle.netb)repl.it/语言/ csharpc)csharpcompiler.netd)dotnet.microsoft.com/platform/try-dotnete)csharppad.com8.如果要指示数字的类型为long,则可以在数字的末尾指定字母l或L.例如:var l = 138l;
我可以使用哪个字母指定小数类型?a)C或cb)D或dc)M或md)E或e9.控制台应用程序的屏幕上将显示包含以下代码的内容: class Program
{
static Program()
{
Console.WriteLine("Static constructor");
}
public Program()
{
Console.WriteLine("Constructor");
}
static void Main(string[] args)
{
Console.WriteLine("Main");
Console.ReadLine();
}
}
回答«Static constructor» «Main»
, . . .
10.结果将显示什么? [Flags]
public enum Status
{
Funny = 0x01,
Hilarious = 0x02,
Boring = 0x04,
Cool = 0x08,
Interesting = 0x10,
Informative = 0x20,
Error = 0x40
}
public static void Main (string[] args) {
var code = 24;
Console.WriteLine (String.Format("This Quiz is: {0}", (Status)code));
}
11. String和string有什么区别?12. Visual Studio符号是什么意思(或至少最初是什么意思)?13.请映射:异步/等待尝试/捕获
带有以下缩写的ValidateAntiForgeryToken:TAP,SEH,STP回答Async/await -> TAP (Task asynchronous programming model)
Try/catch -> SEH (Structured Exception Handling)
ValidateAntiForgeryToken -> STP (Synchronizer Token Pattern)
14.以下哪个不是.NET CMS?a)mojoPortalb)N2 CMSc)原子CMSd)复合材料C1e)混凝土5f)Piranha CMS15.屏幕上将显示什么?(如果显示了某些内容)
class Program
{
private static int y = x;
private static int x = 5;
static void Main(string[] args)
{
Console.WriteLine(y);
Console.ReadLine();
}
}
16. .Net中不存在什么类的并发集合a)ConcurrentQueueb)ConcurrentStackc)ConcurrentListd)ConcurrentDictionarye)ConcurrentBag17.最好使用哪种方法以同步方式调用异步代码(当然,在很少的情况下,当await无法正常工作时,可以这样做):a)Wait()b)Result()c)GetAwaiter()。GetResult()