Skip to content

Instantly share code, notes, and snippets.

@Lahirutech
Last active May 23, 2021 15:20
Show Gist options
  • Save Lahirutech/fdd72946035fd67857a5e4ddbf53860c to your computer and use it in GitHub Desktop.
Save Lahirutech/fdd72946035fd67857a5e4ddbf53860c to your computer and use it in GitHub Desktop.
using System;
public class Student{
public string StudentName { get; set; }
public string Course { get; set; }
}
public class Program
{
public static void UpdateCourse(Student std2)
{
std2.Course = "Computer Science";
}
public static void Main()
{
Student std1 = new Student();
std1.StudentName = "Bill";
std1.Course= "Not Eligible";
Console.WriteLine("Course: "+std1.Course);
UpdateCourse(std1);
Console.WriteLine("Course Updated");
Console.WriteLine("Course: "+std1.Course);
}
}
/*
Course: Not Eligible
Course Updated
Course: Computer Science
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment