Qtr No. 213, New Town Yehlanka
Indore 454775, India
Predict the output of the following code:
class Employee
{
protected int empId;
public Employee(int empId)
{
this.empId = empId;
}
}
class Manager : Employee
{
public void Display()
{
Console.WriteLine("Employee Id : {0}", empId);
}
}
class Program
{
public static void Main()
{
Manager mgrObj = new Manager();
mgrObj.Display();
}
}
Error: There is no argument given that corresponds to the required formal parameter 'empId' of 'Employee.Employee(int)'
Employee Id : 0
Employee Id : Garbage Value
Protected variables cannot be accessed in child class
To get all Basic CSharp Programming Assessment Exam questions Join Telegram Group https://rebrand.ly/lex-telegram-236dee