IDNLearn.com: Your go-to resource for finding expert answers. Discover reliable and timely information on any topic from our network of knowledgeable professionals.
Explain Given: public class Triangle{ public int base; public int height; public double area; public Triangle(int base, int height){ = base; = height; updateArea(); } void updateArea(){ area = base*height/2; } public void setBase(int b){ base = b; updateArea(); } public void setHeight(int h){ height = h; updateArea(); } } The above class needs to protect an invariant on the "area" field. Which three members must have the public access modifiers removed to ensure that the invariant is maintained?This type of question contains radio buttons and checkboxes for selection of options. Use Tab for navigation and Enter or space to select the option. A option A the base field B option B the height field C option C the area field D option D the Triangle constructor E option E the setBase method F option F the setHeight method?
Sagot :
Thank you for using this platform to share and learn. Don't hesitate to keep asking and answering. We value every contribution you make. IDNLearn.com is committed to your satisfaction. Thank you for visiting, and see you next time for more helpful answers.