Challenge: Team Constructor
Oppgave
Swipe to start coding
Here is a class called Team written for you. Your task is to write a constructor that takes all 4 parameters and initializes all 4 fields. Please do not modify the Main class and its methods.
- Write a constructor with 4 parameters:
name,sport,yearFounded, andcity. - Initialize the
namefield with the value of thenameparameter. - Initialize the
sportfield with the value of thesportparameter. - Initialize the
yearFoundedfield with the value of theyearFoundedparameter. - Initialize the
cityfield with the value of thecityparameter.
Løsning
Alt var klart?
Takk for tilbakemeldingene dine!
Seksjon 1. Kapittel 7
single
Spør AI
Spør AI
Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår
Fantastisk!
Completion rate forbedret til 3.57
Challenge: Team Constructor
Sveip for å vise menyen
Oppgave
Swipe to start coding
Here is a class called Team written for you. Your task is to write a constructor that takes all 4 parameters and initializes all 4 fields. Please do not modify the Main class and its methods.
- Write a constructor with 4 parameters:
name,sport,yearFounded, andcity. - Initialize the
namefield with the value of thenameparameter. - Initialize the
sportfield with the value of thesportparameter. - Initialize the
yearFoundedfield with the value of theyearFoundedparameter. - Initialize the
cityfield with the value of thecityparameter.
Løsning
Alt var klart?
Takk for tilbakemeldingene dine!
Seksjon 1. Kapittel 7
single