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

Test #4

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Test #4

wants to merge 8 commits into from

Conversation

ElenaVeshtard
Copy link

Test


interface IShape {
fun square(): Int
fun view(): String
Copy link
Owner

Choose a reason for hiding this comment

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

для этого можно было стандартную функцию использовать toString.
Если к классу добавить data, то она будет добавлена автоматически

class ShapePrinterImpl : IShapePrinter {

override fun printShape(shape: IShape) {
println(shape.view())
Copy link
Owner

@krottv krottv Mar 21, 2022

Choose a reason for hiding this comment

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

Работает всё верно, только для лучшего разделения обязанностей try catch лучше здесь делать. Как будто мы не знаем, какая именно фигура может выбросить exception (а не внутри Triangle)

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.

Необходимы небольшие изменения

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