diff options
Diffstat (limited to 'java.html.markdown')
-rw-r--r-- | java.html.markdown | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/java.html.markdown b/java.html.markdown index 9c60eabc..fa1ff3d1 100644 --- a/java.html.markdown +++ b/java.html.markdown @@ -57,7 +57,7 @@ public class LearnJava { /////////////////////////////////////// /* - * Ouput + * Output */ // Use System.out.println() to print lines. @@ -463,7 +463,11 @@ public class LearnJava { // <second value>" int foo = 5; String bar = (foo < 10) ? "A" : "B"; - System.out.println(bar); // Prints A, because the statement is true + System.out.println("bar : " + bar); // Prints "bar : A", because the + // statement is true. + // Or simply + System.out.println("bar : " + (foo < 10 ? "A" : "B")); + //////////////////////////////////////// // Converting Data Types |