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