I'm trying to create a simple class by referring to a YouTube video, but I get errors.
Here are the errors:
And here is my code:
public class Student
{
public int stdAge;
public int stdiD;
public string stdCitizenship;
public void printStudent()
{
Console.WriteLine("Student Age: " + stdAge);
Console.WriteLine("Student ID: " + stdiD);
Console.WriteLine("Student Citizenship:" + stdCitizenship);
}
}
class Program
{
static void Main(string[] args)
{
Student std1 = new Student("Roslin Hashim");
std1.stdAge(26);
std1.stdiD(520308);
std1.stdCitizenship("Malaysia");
std1.printStudent();
}
}
How do I know what the problem is and how to fix it?