Microsoft .NET اسئلة واجوبة المقابلات
سؤال 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?