Question: Lizzard - Consider the following Lizard class, which simulates the number 3 points of lizards in a local zoo. The getNumLizards method is intended to

 Lizzard - Consider the following Lizard class, which simulates the number

Lizzard - Consider the following Lizard class, which simulates the number 3 points of lizards in a local zoo. The getNumLizards method is intended to allow methods in other classes to access the Lizard objects population value; however, it does not work as intended. Which of the folowing best explains why the getNumLizards method does NOT work as intended?* public class Lizard { private int numLizards; public Lizard(int nl) { numLizards - } nL; public int getNumLizards() { return nL; } }//end class The instance variable numLizards should be returned instead of nL, which is local to the constructor The getNumLizards method should be declared as private. The return type of getNumLizards should be void The getNumLizards method should have at least one parameter

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!