Question: 3 points Jersey - Consider the following class definition. The class does not compile. The accessor method getNumber is intended to return the number of
3 points Jersey - Consider the following class definition. The class does not compile. The accessor method getNumber is intended to return the number of a JerseyNumber object. Which of the following best explains why the class does not compile?* public class JerseyNumber { private int number; // constructor not shown public getNumber() { return number; } } The getNumber method should be declared as private. O The getNumber method requires a parameter. O The return type of the getNumber method needs to be defined as int. O The return type of the getNumber method needs to be defined as String. O The return type of the getNumber method needs to be defined as void
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
