Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package lab;
- import java.util.Scanner;
- class Area {
- Scanner input= new Scanner(System.in);
- int a,b,area;
- void setDim(int x, int y){
- this.a=x;
- this.b=y;
- }
- void getArea(){
- area=a*b;
- System.out.println("Area: "+area);
- }
- }
- public class twom {
- public static void main(String[] args) {
- Area ar= new Area();
- Scanner input= new Scanner(System.in);
- ar.a=input.nextInt();
- ar.b=input.nextInt();
- ar.setDim(ar.a, ar.b);
- ar.getArea();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment