Skip to content
This repository has been archived by the owner on Aug 7, 2024. It is now read-only.

Lesson14 #9

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Lesson14 #9

wants to merge 1 commit into from

Conversation

VadimSazonenko
Copy link

No description provided.

import kotlin.math.PI

data class Circle(val radius: Int) : IShape {
class Circle constructor(radius: Int)
Copy link
Owner

Choose a reason for hiding this comment

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

Зачем внутри класса создавать ещё один класс ?)

Copy link
Owner

@krottv krottv left a comment

Choose a reason for hiding this comment

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

Всё хорошо. Пометил пару моментов

}

override fun toString(): String {
return return println("Площадь кргуа: ${square()}").toString()
Copy link
Owner

Choose a reason for hiding this comment

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

2 раза return? toString переопределять не обязательно, он автоматом сгенерируется, потому что это data class

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants