Advertisement
saykotislam

201-15-13993_7

Feb 21st, 2021
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.52 KB | None | 0 0
  1. package lab;
  2.  
  3. import java.util.Scanner;
  4.  
  5. class Area {
  6.    
  7.     int a,b,area;
  8.     Area(int a, int b){
  9.        this.a=a;
  10.        this.b=b;
  11.     }
  12.     void returnArea(){
  13.         area=a*b;
  14.         System.out.println("Area: "+area);
  15.     }
  16.    
  17. }
  18.  
  19. public class twom {
  20.  
  21.    
  22.     public static void main(String[] args) {
  23.         Scanner input= new Scanner(System.in);
  24.         int a,b;
  25.             a=input.nextInt();
  26.             b=input.nextInt();
  27.         Area ar= new Area(a,b);
  28.         ar.returnArea();
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement