write a class to calculate and print area of a square and area of a rectangle. input required data using scanner class.
no spam otherwise will be reported. you have to write a Java program which should be suitable for class 9 student. if you don't know, don't reply
Anonymous:
hi
Answers
Answered by
1
Answer:
import java.util.*;
class square{
int a,b;
void area(){
System.out.println(a*b);
}
public static void main(String args){
Scanner sc = new Scanner(System.in);
area s = new area();
s.a = sc.nextInt();
s.b = sc.nextInt();
s.area()
}
}
Similar questions
Social Sciences,
4 months ago
Biology,
8 months ago
Math,
8 months ago
Social Sciences,
1 year ago
English,
1 year ago