Define a method void Area () in a class rectangle, which takes two float type arguments for length and breadth ; then, calculate and return the area of the rectangle.
Answers
Answered by
1
Answer:
O hello...... Hang on bro....
Note that the function has 'void' return type i.e; it will not return any value.
Explanation :
For returning the area :-
########
class Rectangle
{
float Area( float l, float b)
{
float areaaa = l * b;
return ( areaaa) ;
}
public static void main (String args [ ] )
{
float R = areaa( 17.6f, 52.f) ; System.out.println("the area of the rectangle = " +
R) ;
} // Main function closed
} // class closed
Hope it's helpful for you
Have a great day ahead
Similar questions
Physics,
3 months ago
Hindi,
3 months ago
Math,
3 months ago
Biology,
6 months ago
Math,
6 months ago
Accountancy,
1 year ago
Accountancy,
1 year ago
Accountancy,
1 year ago