Professional Documents
Culture Documents
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace practice
{
class student
{
public int stdid;
public student()
{
stdid = 100;
}
}
public exam()
{
student student = new student();
student.stdid = 100;
Console.WriteLine(student.stdid);
salaan();
return 200;
}
//Parameterized Method
public int add(int a , int b)
{
return a + b;
}
//properties
public int age { get; set; }
//advanced
public string user;
public string userType
{
get { return user; }
set { user = value; }
}
ex.age = 22;
Console.WriteLine(ex.age);
ex.userType = "Admin";
Console.WriteLine(ex.userType);
exam.stdName = "Ahmed";
Console.WriteLine($"This student is: {exam.stdName}");
}
}
}