The following code does not compile. Why not? Select all the reasons that lead to compilation errors. Select one or more
Posted: Fri Jun 10, 2022 11:58 am
The following code does not compile. Why not? Select all the
reasons that lead to compilation errors.
Select one or more:
-The method SETX does not follow naming
conventions.
-In setY It is illegal to assign a value to
field Y.
-The field x is not correctly initialised.
-The method getX should have a parameter.
-There is no constructor.
-In the addToX method the + operator is
being applied to strings.
-There is a brace (curly bracket) too many.
-The method addToX does not set the instance
variable x to a new value.
-The declaration of the field Y is not valid.
-The class name is not valid.
reasons that lead to compilation errors.
Select one or more:
-The method SETX does not follow naming
conventions.
-In setY It is illegal to assign a value to
field Y.
-The field x is not correctly initialised.
-The method getX should have a parameter.
-There is no constructor.
-In the addToX method the + operator is
being applied to strings.
-There is a brace (curly bracket) too many.
-The method addToX does not set the instance
variable x to a new value.
-The declaration of the field Y is not valid.
-The class name is not valid.