Course Content
Java Extended
Java Extended
Team Constructor Challenge
Task
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!
Team Constructor Challenge
Task
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!
Team Constructor Challenge
Task
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!
Task
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.