07:31C# objects as arguments 🧳
From the creator
C# passing objects as arguments tutorial example explained #C# #objects #arguments using System; namespace MyFirstProgram { class Program { static void Main(string[] args) { Car car1 = new Car("Mustang","red"); Car car2 = Copy(car1); Console.WriteLine(car2.color + " " + car2.model); Console.ReadKey(); } public static void ChangeColor(Car car, String color) { car.color = color; } public static Car Copy(Car car) { return new Car(car.model, car.color); } } class Car { public String model; public String color; public Car(String model, String color) { this.model = model; this.color = color; } } }
Published 2021-07-03 · Watch on YouTube ↗
Availability and playback restrictions are controlled by the original channel.





