Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprende Challenge: Static vs Instance Demo | Static Classes and Members
C# OOP Class Construction Drills

bookChallenge: Static vs Instance Demo

Tarea

Swipe to start coding

Write the complete Vehicle class from scratch, including all required fields, the static member, and the constructor.

  • Define a public static field TotalVehicles to track the total number of vehicles created.
  • Define two public instance fields: Make and Model.
  • Implement a constructor that takes two parameters: make and model.
  • In the constructor, assign the make parameter to the Make field and the model parameter to the Model field.
  • Each time the constructor is called, increment the TotalVehicles static field by one.

Solución

¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 3. Capítulo 6
single

single

Pregunte a AI

expand

Pregunte a AI

ChatGPT

Pregunte lo que quiera o pruebe una de las preguntas sugeridas para comenzar nuestra charla

Suggested prompts:

Can you explain this in simpler terms?

What are some examples related to this topic?

Where can I learn more about this?

close

bookChallenge: Static vs Instance Demo

Desliza para mostrar el menú

Tarea

Swipe to start coding

Write the complete Vehicle class from scratch, including all required fields, the static member, and the constructor.

  • Define a public static field TotalVehicles to track the total number of vehicles created.
  • Define two public instance fields: Make and Model.
  • Implement a constructor that takes two parameters: make and model.
  • In the constructor, assign the make parameter to the Make field and the model parameter to the Model field.
  • Each time the constructor is called, increment the TotalVehicles static field by one.

Solución

Switch to desktopCambia al escritorio para practicar en el mundo realContinúe desde donde se encuentra utilizando una de las siguientes opciones
¿Todo estuvo claro?

¿Cómo podemos mejorarlo?

¡Gracias por tus comentarios!

Sección 3. Capítulo 6
single

single

some-alt