case class Goods
(name
: String, number
: Int, amount
: Int, price
: Int, date
: Date
) { def cost
= amount
* price
}
val goods
= Goods
("Дилдо",
123,
5,
100,
new Date
()) println(goods.cost + "$")
println(goods.copy(price = 110).cost + "$")
}
aW1wb3J0IGphdmEudXRpbC5EYXRlCgpjYXNlIGNsYXNzIEdvb2RzKG5hbWU6IFN0cmluZywgbnVtYmVyOiBJbnQsIGFtb3VudDogSW50LCBwcmljZTogSW50LCBkYXRlOiBEYXRlKSB7CglkZWYgY29zdCA9IGFtb3VudCAqIHByaWNlCn0KCm9iamVjdCBNYWluIGV4dGVuZHMgQXBwIHsKCXZhbCBnb29kcyA9IEdvb2RzKCLQlNC40LvQtNC+IiwgMTIzLCA1LCAxMDAsIG5ldyBEYXRlKCkpCglwcmludGxuKGdvb2RzLmNvc3QgKyAiJCIpCglwcmludGxuKGdvb2RzLmNvcHkocHJpY2UgPSAxMTApLmNvc3QgKyAiJCIpCn0=