Course Content
Java Extended
Java Extended
Challenge: Team Constructor
Swipe to show code editor
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
name
field with the value of thename
parameter. - Initialize the
sport
field with the value of thesport
parameter. - Initialize the
yearFounded
field with the value of theyearFounded
parameter. - Initialize the
city
field with the value of thecity
parameter.
Thanks for your feedback!
Challenge: Team Constructor
Swipe to show code editor
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
name
field with the value of thename
parameter. - Initialize the
sport
field with the value of thesport
parameter. - Initialize the
yearFounded
field with the value of theyearFounded
parameter. - Initialize the
city
field with the value of thecity
parameter.
Thanks for your feedback!
Challenge: Team Constructor
Swipe to show code editor
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
name
field with the value of thename
parameter. - Initialize the
sport
field with the value of thesport
parameter. - Initialize the
yearFounded
field with the value of theyearFounded
parameter. - Initialize the
city
field with the value of thecity
parameter.
Thanks for your feedback!
Swipe to show code editor
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
name
field with the value of thename
parameter. - Initialize the
sport
field with the value of thesport
parameter. - Initialize the
yearFounded
field with the value of theyearFounded
parameter. - Initialize the
city
field with the value of thecity
parameter.