Microsoft .NET 面接の質問と回答
Test your skills through the online practice test: Microsoft .NET Quiz Online Practice Test
質問 31. Write code to show how a method can accept a varying number of parameters.
using System;
namespace Console1
{
class Class1
{
static void Main(string[] args)
{
ParamsMethod(1,"example");
ParamsMethod(1,2,3,4);
Console.ReadLine();
}
static void ParamsMethod(params object[] list)
{
foreach (object o in list)
{
Console.WriteLine(o.ToString());
}
}
}
}
役に立ちましたか?
コメントを追加
コメントを見る
質問 32. What is an overloaded method?
An overloaded method has multiple signatures that are different.
役に立ちましたか?
コメントを追加
コメントを見る
質問 33. What is recursion?
Recursion is when a method calls itself.
役に立ちましたか?
コメントを追加
コメントを見る
質問 34. What is a constructor?
A constructor performs initialisation for an object (including the struct type) or class.
役に立ちましたか?
コメントを追加
コメントを見る
質問 35. If I have a constructor with a parameter, do I need to explicitly create a default constructor?
Yes
役に立ちましたか?
コメントを追加
コメントを見る
ユーザー評価で最も役立つ内容:
- Name 10 C# keywords.
- What is public accessibility?
- .NET Stands for?
- What is private accessibility?
- What is protected accessibility?