Question: 0 . 5 points Consider the following Party class. The getNumOfPeople method is intended to allow methods in other classes to access a Party object's
points Consider the following Party class. The getNumOfPeople method is intended to allow methods in other classes to access a Party object's numOfPeople instance variable valu however, it does not work as intended. Which of the following best explains why the getNum OfPeople method does NOT work as intended?The getNumOfPeople method should be declared as public.The variable numOfPeople is not declared inside the getNumOfPeople method.The getNumOfPeople method should have at least one parameter.The return type of the getNumOfPeople method should be void.The instance variable num should be returned instead of num OfPeople, which is local to the constructor. points Consider the following Party class. The getNumOfPeople method is intended to allow methods in other classes to access a Party object's numOfPeople instance variable valu however, it does not work as intended. Which of the following best explains why the getNum OfPeople method
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
