C# - Programming Language
This course covers the basics of programming in C#. Work your way through the videos and we'll teach you everything you need to know to start your programming journey!

Static Class Attributes

Lesson 29
Author : Mike Dane
Last Updated : November, 2017


Code

Copypublic class Song{
     public string title;
     public string artist;
     public static int songCount = 0;

     public Song(string title, string artist){
          this.title = title;
          this.artist = artist;
          songCount++;
     }
}

public class App
{
     public static void Main(string[] args)
     {
          Song song1 = new Song("Holiday", "Green Day");

          Console.WriteLine(Song.songCount)
     }
}