Challenge: Overloaded Movie Class
Tâche
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
Titleto"Unknown"andReleaseYearto0. - The class must have a constructor that takes a
titleparameter and setsTitleto the given value andReleaseYearto0. - The class must have a constructor that takes both a
titleand areleaseYear, and sets the fields accordingly.
Solution
Tout était clair ?
Merci pour vos commentaires !
Section 1. Chapitre 4
single
Demandez à l'IA
Demandez à l'IA
Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion
Suggested prompts:
Can you explain this in simpler terms?
What are the main takeaways from this?
Can you give me an example?
Génial!
Completion taux amélioré à 4.17
Challenge: Overloaded Movie Class
Glissez pour afficher le menu
Tâche
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
Titleto"Unknown"andReleaseYearto0. - The class must have a constructor that takes a
titleparameter and setsTitleto the given value andReleaseYearto0. - The class must have a constructor that takes both a
titleand areleaseYear, and sets the fields accordingly.
Solution
Tout était clair ?
Merci pour vos commentaires !
Section 1. Chapitre 4
single