Last active
December 8, 2015 17:54
-
-
Save makiftutuncu/843db5cba8ab35af0f6e to your computer and use it in GitHub Desktop.
Scala'da Koşul İfadeleri yazımdaki örnek 1
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
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