Skip to content

Instantly share code, notes, and snippets.

@PrateekKumarSingh
Created January 26, 2021 15:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PrateekKumarSingh/72a26e43b63148655fb93cdcb2d52e48 to your computer and use it in GitHub Desktop.
Save PrateekKumarSingh/72a26e43b63148655fb93cdcb2d52e48 to your computer and use it in GitHub Desktop.
class Book
{
public string Name = "";
public string Author = "";
}
Book X = new Book();
X.Name = "Harry Potter";
X.Author = "J. K. Rowling";
// reference type variable
Book Y = X;
// changing value of 'Y' variable with change value of 'X'
Y.Name = "The Casual Vacancy";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment