Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Challenge: Overloaded Movie Class | Constructors and Overloading
C# OOP Class Construction Drills

bookChallenge: Overloaded Movie Class

Oppgave

Swipe to start coding

Create a Movie class that supports multiple ways to initialize its fields using overloaded constructors.

  • The class must have a default constructor that sets the Title to "Unknown" and ReleaseYear to 0.
  • The class must have a constructor that takes a title parameter and sets Title to the given value and ReleaseYear to 0.
  • The class must have a constructor that takes both a title and a releaseYear, and sets the fields accordingly.

Løsning

Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 1. Kapittel 4
single

single

Spør AI

expand

Spør AI

ChatGPT

Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår

Suggested prompts:

Can you explain this in simpler terms?

What are the main takeaways from this?

Can you give me an example?

close

bookChallenge: Overloaded Movie Class

Sveip for å vise menyen

Oppgave

Swipe to start coding

Create a Movie class that supports multiple ways to initialize its fields using overloaded constructors.

  • The class must have a default constructor that sets the Title to "Unknown" and ReleaseYear to 0.
  • The class must have a constructor that takes a title parameter and sets Title to the given value and ReleaseYear to 0.
  • The class must have a constructor that takes both a title and a releaseYear, and sets the fields accordingly.

Løsning

Switch to desktopBytt til skrivebordet for virkelighetspraksisFortsett der du er med et av alternativene nedenfor
Alt var klart?

Hvordan kan vi forbedre det?

Takk for tilbakemeldingene dine!

Seksjon 1. Kapittel 4
single

single

some-alt