Example 1-Picture Frames-Objects-Solution:

Create a project with two classes (files), the main class "Frames for Pictures" with the main method and the second class "PictureFrame", which actually represents a rectangle with the necessary data (class properties), side and area.
The "PictureFrame" class should look like the picture:objects in java examples: Class PictureFrame-definition
Figure 1: Class PictureFrame-definition
In the main class, you need to create objects, enter the lengths and widths of the frames, calculate the areas and display them on the screen. The main class should look like the following image:objects in JAVA examples: Class FramesForPictures-definition
Figure 2: Class FramesForPictures-definition

Return to additional example - classes and objects in JAVA