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.
The following code does not compile. Why not? Select all the reasons that lead to compilation errors. Select one or more
-
- Posts: 43759
- Joined: Sat Aug 07, 2021 7:38 am