using System;
using [Link];
using [Link];
using [Link];
using [Link];
namespace static_method_practice
{
class Program
{
static void Main(string[] args)
{
Student stu1 = new Student(); //Creates my first object of student
//[Link](); //calling the static method
[Link](12345);
[Link]("Patrick Crampton");
[Link]("B");
Student stu2 = new Student(123456);
[Link]("stu2 has been init with ID {0}",[Link]());
//this will display and call the 3rd students info
Student stu3 = new Student(23456,"jim bob", "c");
[Link]("\nStu3 details \nID: {0}\nName: {1}\nGrade:
{2}", [Link](), [Link](), [Link]());
[Link]("number of Students : {0}",
[Link] );//calling the static method
[Link]("Stu1 details \nID: {0}\nName: {1}\nGrade:
{2}",[Link](),[Link](),[Link]());//calling the non static
method
using System;
using [Link];
using [Link];
using [Link];
using [Link];
namespace static_method_practice
{
class Student
{
public static int numStudents;
//instance variables
private int stuID;
private string name;
private string grade;
public static void CountStudents()
{
numStudents++;
//paramertaless constructor
public Student()
{
[Link]("a New student object has been created");
numStudents++;
}
//paramater constructor
public Student(int id)
{
stuID = id;
[Link]("a New student object has been created");
numStudents++;
}
//add a third Parameter cosnrucytor which has 3 parameters - init all
3
public Student(int id, string nm,string gd)
{
stuID = id;
name = nm;
grade = gd;
[Link]("a New student object has been created");
numStudents++;
//methods
public void SetID(int id)
{
stuID = id;
}
public int GetID()
{
return stuID;
}
public void SetName(string nm)
{
name = nm;
}
public string GetName()
{
return name;
}
public void setgrade(string gd)
{
grade = gd;
}
public string GetGrade()
{
return grade;
}
}
}