Answered step by step
Verified Expert Solution
Question
1 Approved Answer
A C# question. A class Employee field salary need to be declared constant like public class Employee() { private string name; private constant int salary
A C# question.
A class "Employee" field "salary" need to be declared constant like
public class Employee()
{
private string name;
private constant int salary = 2500
so the constructor is like
public Employee (string name, int salary){
this.name= name;
this. salary = salary;}
what is wrong with this piece of code. the error is
Error CS0176 Member 'employee.salary' cannot be accessed with an instance reference; qualify it with a type name instead
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started