Skip to content

Instantly share code, notes, and snippets.

@makiftutuncu
Last active December 8, 2015 17:54
Show Gist options
  • Save makiftutuncu/843db5cba8ab35af0f6e to your computer and use it in GitHub Desktop.
Save makiftutuncu/843db5cba8ab35af0f6e to your computer and use it in GitHub Desktop.
Scala'da Koşul İfadeleri yazımdaki örnek 1
if (1 == 1 && (true || false) {
// Bu her zaman çalışacak
val mesaj = "1 == 1"
println(mesaj)
} else if (2 != 2) {
// Bu hiç çalışmayacak
println("2 != 2")
} else {
// Bu hiç da çalışmayacak
println("1 != 1")
}
// Gövdede tek bir ifade olduğunda süslü parantez kullanmayabilirsiniz.
if (1 == 1 && true) println("1 == 1") else println("1 != 1")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment