Run ❯
Get your
own C#
server
❯
Run Code
Ctrl+Alt+R
Change Orientation
Ctrl+Alt+O
Change Theme
Ctrl+Alt+D
Change Language
Go to Spaces
Ctrl+Alt+P
using System; namespace MyApplication { class Car { public string model; public static int count = 0; public Car(string model) { this.model = model; count++; } } class Program { static void Main(string[] args) { Car car1 = new Car("Volvo"); Car car2 = new Car("BMW"); Car car3 = new Car("Ford"); Console.WriteLine(car1.model + ", " + car2.model + ", " + car3.model); Console.WriteLine("Cars created: " + Car.count); } } }
Volvo, BMW, Ford
Cars created: 3