-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRectangle.java
More file actions
36 lines (35 loc) · 809 Bytes
/
Copy pathRectangle.java
File metadata and controls
36 lines (35 loc) · 809 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
* 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 com.mycompany.lab1_ip;
/**
*
* @author crist
*/
final class Rectangle implements ShapeInterface{
public double height = 4, width = 2, area = 5;
@Override
public void printShape()
{
System.out.println("I'm a Rectangle");
}
@Override
public double getArea()
{
System.out.println(area);
return area;
}
@Override
public void onAreaChange()
{
area = width*height;
System.out.println(area);
}
public void onAreaChange(int sWidth, int sHeight)
{
area = sWidth*sHeight;
System.out.println(area);
}
}