Skip to content

Instantly share code, notes, and snippets.

@makiftutuncu
Created December 5, 2015 09:45
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/fdd4975e556363bf2d31 to your computer and use it in GitHub Desktop.
Save makiftutuncu/fdd4975e556363bf2d31 to your computer and use it in GitHub Desktop.
Scala'da Temel Kavramlar yazısınındaki örnek 5
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