Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package rectangle;
- public class Rectangle {
- private int height=0, width=0, field = 0;
- Rectangle(int h, int w)
- {
- height = h;
- width = w;
- field = h*w;
- }
- Rectangle(int a)
- {
- this(a,a);
- }
- int getHeight()
- {
- return height;
- }
- int getWidth()
- {
- return width;
- }
- int getField()
- {
- return field;
- }
- void setHeight(int a)
- {
- height = a;
- }
- void setWidth(int a)
- {
- width = a;
- }
- void wypisz ()
- {
- System.out.println("Height of rectangle is " + getHeight());
- System.out.println("Width of rectangle is " + getWidth());
- System.out.println("Field of rectangle is " + getField());
- }
- public static void main(String[] args)
- {
- Rectangle a[] =new Rectangle[7];
- a =
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement