Scala'da Temel Kavramlar yazısınındaki örnek 3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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