Skip to content

Instantly share code, notes, and snippets.

@makiftutuncu
Last active December 5, 2015 09:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save makiftutuncu/1290e6ef859996f4abc8 to your computer and use it in GitHub Desktop.
Save makiftutuncu/1290e6ef859996f4abc8 to your computer and use it in GitHub Desktop.
Scala'da Temel Kavramlar yazısınındaki örnek 3
def buBirMetod {}
def buDa = {}
def hattaBuDa: Unit = {}
def veHattaBuDa(): Unit = {}
buBirMetod
veHattaBuDa()
def sayi = 5
def sayi2() = 6
def topla(s1: Int, s2: Int) = s1 + s2
def carp(s1: Int)(s2: Int) = s1 * s2
def karistir() = {
val sonuc1 = topla(sayi, sayi2())
val sonuc2 = carp(sayi)(sayi2())
topla(sonuc1, sonuc2)
}
val toplam = topla(2, 3)
val carpim = carp(3)(5)
karistir()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment