Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Practicing `static` Keyword | OOP Essentials
C# Beyond Basics
course content

Conteúdo do Curso

C# Beyond Basics

Practicing `static` Keyword

In this problem, you need to:

  • Create a new private field called totalCars of type double which tracks the total number of Car objects created;
  • Create a getter method called getTotalCars which simply returns the number of objects;
  • Make sure the value of the totalCars field is incremented every time a new Car object is created.
cs

index

Tudo estava claro?

Seção 4. Capítulo 6
We're sorry to hear that something went wrong. What happened?
some-alt