Created
December 5, 2015 09:45
-
-
Save makiftutuncu/fdd4975e556363bf2d31 to your computer and use it in GitHub Desktop.
Scala'da Temel Kavramlar yazısınındaki örnek 5
This file contains hidden or 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 tanit(adi: String, soyadi: String, yasi: Int, erkekMi: Boolean): Unit = { | |
def cinsiyet(e: Boolean): String = { | |
if (e) { | |
"Erkek" | |
} else { | |
"Kadın" | |
} | |
} | |
println("Adı : " + adi) | |
println("Soyadı : " + soyadi) | |
println("Yaşı : " + yasi) | |
println("Cinsiyeti: " + cinsiyet(erkekMi)) | |
} | |
tanit("Mehmet Akif", "Tütüncü", 24, true) | |
tanit(adi = "Mehmet Akif", soyadi = "Tütüncü", yasi = 24, erkekMi = true) | |
tanit("Mehmet Akif", soyadi = "Tütüncü", 24, erkekMi = true) | |
tanit(soyadi = "Tütüncü", erkekMi = true, adi = "Mehmet Akif", yasi = 24) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment