Skip to content

Rectangle by @AlexU238#2

Open
AlexU238 wants to merge 1 commit into
oleksandr-kazimirov:masterfrom
TrainingInc:master
Open

Rectangle by @AlexU238#2
AlexU238 wants to merge 1 commit into
oleksandr-kazimirov:masterfrom
TrainingInc:master

Conversation

@AlexU238
Copy link
Copy Markdown

No description provided.

Comment thread Rectangle.java
@@ -0,0 +1,38 @@
public class Rectangle {
private int hight;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'height' and 'width' variables

Comment thread Rectangle.java
private int width;

public Rectangle(){

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the purpose of empty constructor? What values are going to be used for height' and 'width' variables?

Comment thread Rectangle.java
}

public void findPerimeter(){
System.out.println("Периметр прямоугольника == "+(2*(hight+width)));
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pls use space between math sign and variable
' " + (2 * (height + width)) ' is reading easier than without space.

Comment thread Rectangle.java
}


public int getHight() {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why both setters and getters? It is easier to do a 'public' field.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants