Java Program - Static Block with variable initialization - Area of a parallelogram

Опубликовано: 04 Октябрь 2024
на канале: Step By Step
66
3

Write a program with a main method. It outputs the area of a parallelogram with breadth and height .
Conditions –
1. You should read the variables from the standard input.
2. If  breadth and height is less than equal to zero , the output should be "Breadth and height must be positive".
3. The variables should be initialized in static block.