Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.