Question: The Triangle class is derived from the RegPolygon class. Using the UML diagrams shown below, complete the following: A. List any overloaded methods in the

The Triangle class is derived from the RegPolygon class. Using the UML diagrams shown below, complete the following:

RegPolygon lenSide: int Reg Polygon () RegPolygon (lenSide: int) setLenSide (lenSide: int)

A. List any overloaded methods in the RegPolygon and Triangle classes.
B. List any overriding methods in the RegPolygon and Triangle classes.
C. If the variable lenSide is a private data member of the RegPolygon class, is lenSide accessible from the Triangle class?
D. If the variable lenside is a protected data member of the RegPolygon class, is lenSide accessible from the Triangle class?
E. If the variable lenside is a protected data member of the RegPolygon class, is lenSide accessible from the main method?

RegPolygon lenSide: int Reg Polygon () RegPolygon (lenSide: int) setLenSide (lenSide: int) get LenSide (): int calcReg PolyArea (): double. toString (): String equals (regPolygon: RegPolygon): boolean makeCopy (reg Polygon: RegPolygon) Triangle Triangle () Triangle (lenSide: int) calcRegPolyArea (): double toString (): String equals (triangle: Triangle) : boolean make Copy (triangle: Triangle)

Step by Step Solution

3.36 Rating (140 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Based on the UML diagrams provided for the RegPolygon and Triangle classes here are the answers to the questions A List any overloaded methods in the ... View full answer

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 Introduction Java Program Questions!