static void DeconstructSample() { string first = "John", last = "Doe"; Lesson13 lesson13 = new Lesson13(first, last); Console.WriteLine("Frist Name: {0} \n Last Name: {1}", first, last); lesson13.Deconstruct(out first, out last); Console.WriteLine("Frist Name: {0} \n Last Name: {1}", first, last); }
static void Lesson13() { String first = "Carl", second = "Hamlett"; Lesson13 lesson13 = new Lesson13(first, second); Console.WriteLine("First Name = {0} and Last Name = {1}", first, second); lesson13.Deconstruct(out first, out second); Console.WriteLine("Last Name = {1} and First Name = {0}", first, second); }
static void DeconstractSample() { string first = "Tom", last = "Jones"; Lesson13 lesson13 = new Lesson13("Jhon", "Doe"); Console.WriteLine("First Name = {0} and LastName = {1}", first, last); lesson13.Deconstruct(out first, out last); Console.WriteLine("First Name = {0} and Last Name = {1}", first, last); }
static void deconstructSample() { string first = "Fikadu", last = "Dessalegn"; Lesson13 lesson = new Lesson13("Bella", "Hailu"); Console.WriteLine("First Name = {0} and Last Name = {1}", first, last); lesson.Deconstruct(out first, out last); Console.WriteLine("First Name = {0} and Last Name = {1}", first, last); }
static void DeconstructSample() { string first = "Tom", last = "Jones"; //create object, constructor, 2 variables variable to field Lesson13 lesson13 = new Lesson13("John", "Doe"); //print values only Console.WriteLine("First Name = {0} and Last Name = {1}", first, last); //field to variable lesson13.Deconstruct(out first, out last); Console.WriteLine("First Name = {0} and Last Name = {1}", first, last); }