Create a class called SweetBox. It must have two fields: sweet of "some type" (for example, Chocolate or Marmalade) and numOfSweets, which is Int. Also, the class should have a primary constructor, which initializes sweet and numOfSweets.
Introduction to generic programming
Sweety coding
Report a typo
Write a program in Kotlin
// define the class
class SweetBox {
}
// don't change classes below
class Chocolate
class Marmelade
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.