Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
10 views1 page

Tarun Javac

The document contains a Java program that defines a Rectangle class with methods to read dimensions and calculate the area. However, there are several syntax errors, such as incorrect casing and missing punctuation. The main method in the RectangleDemo class attempts to create a Rectangle object and invoke its methods, but it will not compile due to these errors.

Uploaded by

ch likhita
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views1 page

Tarun Javac

The document contains a Java program that defines a Rectangle class with methods to read dimensions and calculate the area. However, there are several syntax errors, such as incorrect casing and missing punctuation. The main method in the RectangleDemo class attempts to create a Rectangle object and invoke its methods, but it will not compile due to these errors.

Uploaded by

ch likhita
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

import java.util.

Scanner
class Rectangle
{
double l,b;
Scanner sc=new scanner(system.in);
void read data()
{
l=sc.next Double();
b=sc.next Double();
}
void area()
{
system.out.println("area of rectangle is"+(l*b));
}
}
class Rectangle Demo
{
public ststic void main(string[] args)
{
Rectangle r1=new Rectangle;
r1.read data();
r1.area();
}
}

You might also like