saykotislam

201-15-13993_6

Feb 21st, 2021
45
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package lab;
  2.  
  3. import java.util.Scanner;
  4.  
  5. class Area {
  6.     Scanner input= new Scanner(System.in);
  7.     int a,b,area;
  8.     void setDim(int x, int y){
  9.        this.a=x;
  10.        this.b=y;
  11.     }
  12.     void getArea(){
  13.         area=a*b;
  14.         System.out.println("Area: "+area);
  15.     }
  16. }
  17.  
  18. public class twom {
  19.  
  20.    
  21.     public static void main(String[] args) {
  22.         Area ar= new Area();
  23.         Scanner input= new Scanner(System.in);
  24.             ar.a=input.nextInt();
  25.             ar.b=input.nextInt();
  26.         ar.setDim(ar.a, ar.b);
  27.         ar.getArea();
  28.     }
  29.    
  30. }
RAW Paste Data