summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--haskell.html.markdown2
-rw-r--r--java.html.markdown6
2 files changed, 4 insertions, 4 deletions
diff --git a/haskell.html.markdown b/haskell.html.markdown
index 08611e63..936744a0 100644
--- a/haskell.html.markdown
+++ b/haskell.html.markdown
@@ -81,7 +81,7 @@ not False -- True
[5,4..1] -- [5, 4, 3, 2, 1]
-- indexing into a list
-[0..] !! 5 -- 5
+[1..10] !! 3 -- 4
-- You can also have infinite lists in Haskell!
[1..] -- a list of all the natural numbers
diff --git a/java.html.markdown b/java.html.markdown
index 1813f81c..2836f601 100644
--- a/java.html.markdown
+++ b/java.html.markdown
@@ -207,8 +207,8 @@ public class LearnJava {
System.out.println("1+2 = " + (i1 + i2)); // => 3
System.out.println("2-1 = " + (i2 - i1)); // => 1
System.out.println("2*1 = " + (i2 * i1)); // => 2
- System.out.println("1/2 = " + (i1 / i2)); // => 0 (0.5 truncated down)
- System.out.println("1/2 = " + (i1 / (i2*1.0))); // => 0.5
+ System.out.println("1/2 = " + (i1 / i2)); // => 0 (int/int returns an int)
+ System.out.println("1/2 = " + (i1 / (double)i2)); // => 0.5
// Modulo
System.out.println("11%3 = "+(11 % 3)); // => 2
@@ -416,7 +416,7 @@ public class LearnJava {
// easier way, by using something that is called Double Brace
// Initialization.
- private static final Set<String> COUNTRIES = HashSet<String>() {{
+ private static final Set<String> COUNTRIES = new HashSet<String>() {{
add("DENMARK");
add("SWEDEN");
add("FINLAND");