0) What will be output of following c# code ? (base class understanding)
(1) C# default access modifier
namespace : public enum : publicinterface : publicclass : private
struct : private
delegate : private
constructor : private (note if no constructor is explicitly defined,
a public default constructor will be automatically defined)
method : private
field : privateenum member : publiccinterface member: publicFor example
namespace AccessDemo
{
class OuterClass
{
void MethodA() {}
class InnerClass {}
}
}
is equivalent to
namespace AccessDemo
{
internal class OuterClass
{
private void MethodA() {}
private class InnerClass {}
}
}
(2)In Console Application, how to get input from the user ?
Ans : Using Console.ReadLine()Console.Write("Enter input : ");
string userinput = Console.ReadLine();
Console.WriteLine("You entered '{0}'", userinput
);
output :
Enter input : test input
You entered 'test input'
'
