wap the to print a series by using Java .
don't scam . otherwise I will do a report.
Attachments:
Answers
Answered by
0
class FindRectangleArea
{
public static void main(String arg[])
{
Rectangle rect = new Rectangle(10, 5);
System.out.println("Length = " + rect.length);
System.out.println("Breadth = " + rect.breadth);
System.out.println("Area = " + rect.getArea());
System.out.println("Perimeter = " + rect.getPerimeter());
}
}
class Rectangle
{
double length;
double breadth;
Rectangle(double length, double breadth)
{
this.length = length;
this.breadth = breadth;
}
double getArea()
{
return length * breadth;
}
double getPerimeter()
{
return 2 * (length + breadth);
}
Similar questions
Social Sciences,
23 days ago
Political Science,
23 days ago
Social Sciences,
1 month ago
English,
9 months ago
English,
9 months ago