Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package javaapp10;
- public class Rectangle implements IShape{
- // свойства
- int x;
- int y;
- int w;
- int h;
- //
- public Rectangle(int x1, int y1, int w1, int h1){
- x = x1;
- y = y1;
- w = w1;
- h = h1;
- }
- // Создать метод который находит площадь прямоугольника на основе свойств данного класса.
- public int getAreaSize(){
- return w * h;
- }
- // метода
- @Override
- public int getX() {
- return x;
- }
- @Override
- public int getY() {
- return y;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement