Course Hive
Search

Welcome

Sign in or create your account

Continue with Google
or
C# objects as arguments ๐Ÿงณ
Play lesson

C# tutorial for beginners ๐ŸŽต - C# objects as arguments ๐Ÿงณ

5.0 (6)
48 learners

What you'll learn

This course includes

  • 4 hours of video
  • Certificate of completion
  • Access on mobile and TV

Summary

Keywords

Full Transcript

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; } } }

Course Hive

Continue this lesson in the app

Install CourseHive on Android or iOS to keep learning while you move.

Related Courses

FAQs

Course Hive
Download CourseHive
Keep learning anywhere