diff options
author | Ha-Duong, NGUYEN <cmpitg@gmail.com> | 2015-08-03 15:49:54 +0700 |
---|---|---|
committer | Ha-Duong, NGUYEN <cmpitg@gmail.com> | 2015-08-03 15:49:54 +0700 |
commit | 5b683b34ddb313b8981f360c4a6b54cfbc3af396 (patch) | |
tree | 70a69f52480557198a1ee829798cbdffe14335a7 /scala.html.markdown | |
parent | 8c06438ec9aec991b78bbd49d2343dc820da7669 (diff) |
scala: easier-to-look comment
Diffstat (limited to 'scala.html.markdown')
-rw-r--r-- | scala.html.markdown | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/scala.html.markdown b/scala.html.markdown index 03d80043..0bd1a56d 100644 --- a/scala.html.markdown +++ b/scala.html.markdown @@ -51,9 +51,9 @@ print("Hello world") // val declarations are immutable, whereas vars are mutable. Immutability is // a good thing. val x = 10 // x is now 10 -x = 20 // error: reassignment to val +x = 20 // error: reassignment to val var y = 10 -y = 20 // y is now 20 +y = 20 // y is now 20 /* Scala is a statically typed language, yet note that in the above declarations, @@ -73,17 +73,17 @@ true false // Boolean operations -!true // false -!false // true +!true // false +!false // true true == false // false -10 > 5 // true +10 > 5 // true // Math is as per usual -1 + 1 // 2 -2 - 1 // 1 -5 * 3 // 15 -6 / 2 // 3 -6 / 4 // 1 +1 + 1 // 2 +2 - 1 // 1 +5 * 3 // 15 +6 / 2 // 3 +6 / 4 // 1 6.0 / 4 // 1.5 |