In Java
Create new Rectangle, Square, and Triangle classes that include an inner class with methods for area calculation. For example, the Rectangle class will have an inner class with a method that calculates the area for a rectangle.
Create another inner class within the above method that stores the formulas for area calculation.
Create another static inner class that has an addArea static method. This method adds up all the areas calculated so far for rectangles.