Skip to content

Instantly share code, notes, and snippets.

@makiftutuncu
Last active December 8, 2015 20:17
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save makiftutuncu/c15d10b69f1b1a45dbf8 to your computer and use it in GitHub Desktop.
Scala'da Koşul İfadeleri yazımdaki örnek 3
String metin = "merhaba";
int uzunlukSeviyesi = metin.length < 2 ? 1 : (metin.length < 4 ? 2 : 3);
switch (uzunlukSeviyesi) {
case 1:
System.out.println("Çok kısa");
break;
case 2:
System.out.println("Kısa");
break;
default:
System.out.println("Çok kısa");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment