Skip to content

Instantly share code, notes, and snippets.

Created November 29, 2015 21:09
What would you like to do?
Neden Scala? yazısı için örnek Scala kodu
case class Insan(yas: Int)
object NedenScala {
def main(args: Array[String]) {
val insanlar = for (i <- 1 to 10) yield Insan(scala.util.Random.nextInt(30) + 5)
insanlar foreach println
println("Yaşları toplamı:")
println(insanlar.foldLeft(0)(_ + _.yas))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment