1
0
mirror of https://github.com/adambard/learnxinyminutes-docs.git synced 2025-01-17 21:49:22 +01:00

[java] Missing semi-colon at code example

This commit is contained in:
Christos Kontas 2013-10-08 19:09:12 +03:00
parent 80e8200b55
commit 925ded8780

View File

@ -250,7 +250,7 @@ public class LearnJava {
// Conditional Shorthand // Conditional Shorthand
// You can use the '?' operator for quick assignments or logic forks. // You can use the '?' operator for quick assignments or logic forks.
// Reads as "If (statement) is true, use <first value>, otherwise, use <second value>" // Reads as "If (statement) is true, use <first value>, otherwise, use <second value>"
int foo = 5 int foo = 5;
String bar = (foo < 10) ? "A" : "B"; String bar = (foo < 10) ? "A" : "B";
System.out.println(bar); // Prints A, because the statement is true System.out.println(bar); // Prints A, because the statement is true