Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.