Course Hive
Search

Welcome

Sign in or create your account

Continue with Google
or
C# static ๐Ÿšซ
Play lesson

C# tutorial for beginners ๐ŸŽต - C# static ๐Ÿšซ

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# static modifier tutorial example explained #C# #static #modifier using System; namespace MyFirstProgram { class Program { static void Main(string[] args) { // static = modifier to declare a static member, which belongs to the class itself // rather than to any specific object Car car1 = new Car("Mustang"); Car car2 = new Car("Corvette"); Car car3 = new Car("Lambo"); Console.WriteLine(Car.numberOfCars); Car.StartRace(); Console.ReadKey(); } } class Car { String model; public static int numberOfCars; public Car(String model) { this.model = model; numberOfCars++; } public static void StartRace() { Console.WriteLine("The race has begun!"); } } }

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