summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--clojure.html.markdown2
-rw-r--r--java.html.markdown19
2 files changed, 13 insertions, 8 deletions
diff --git a/clojure.html.markdown b/clojure.html.markdown
index 12611fd3..cb202a92 100644
--- a/clojure.html.markdown
+++ b/clojure.html.markdown
@@ -5,7 +5,7 @@ author_url: http://adambard.com/
filename: test.clj
---
-Clojure is a variant of LISP developed for the Java Virtual Machine. It has
+Clojure is a Lisp family language developed for the Java Virtual Machine. It has
a much stronger emphasis on pure [functional programming](https://en.wikipedia.org/wiki/Functional_programming) than
Common Lisp, but includes several [STM](https://en.wikipedia.org/wiki/Software_transactional_memory) utilities to handle
state as it comes up.
diff --git a/java.html.markdown b/java.html.markdown
index 3208971d..3339b6d1 100644
--- a/java.html.markdown
+++ b/java.html.markdown
@@ -19,10 +19,10 @@ Java is a general-purpose, concurrent, class-based, object-oriented computer pro
Multi-line comments look like this.
*/
-// Import Packages
+// Import ArrayList class inside of the java.util package
import java.util.ArrayList;
-// Import all "sub-packages"
-import java.lang.Math.*;
+// Import all classes inside of java.lang package
+import java.lang.*;
// Inside of the learnjava class, is your program's
// starting point. The main method.
@@ -93,6 +93,9 @@ int [] intArray = new int[10];
String [] stringArray = new String[1];
boolean [] booleanArray = new boolean[100];
+// Another way to declare & initialize an array
+int [] y = {9000, 1000, 1337};
+
// Indexing an array - Accessing an element
System.out.println("intArray @ 0: "+intArray[0]);
@@ -118,9 +121,9 @@ int i1 = 1, i2 = 2; // Shorthand for multiple declarations
// Arithmetic is straightforward
System.out.println("1+2 = "+(i1 + i2)); // => 3
-System.out.println("1+2 = "+(i2 - i1)); // => 1
-System.out.println("1+2 = "+(i2 * i1)); // => 2
-System.out.println("1+2 = "+(i1 / i2)); // => 0 (0.5, but truncated towards 0)
+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, but truncated towards 0)
// Modulo
System.out.println("11%3 = "+(11 % 3)); // => 2
@@ -245,7 +248,7 @@ Integer.toString(123);//returns a string version of 123
// Long
// String
-// Typecsating
+// Typecasting
// You can also cast java objects, there's a lot of details and
// deals with some more intermediate concepts.
// Feel free to check it out here: http://docs.oracle.com/javase/tutorial/java/IandI/subclasses.html
@@ -346,4 +349,6 @@ Other Topics To Research:
* [Generics](http://docs.oracle.com/javase/tutorial/java/generics/index.html)
+* [Java Code Conventions](http://www.oracle.com/technetwork/java/codeconv-138413.html)
+
* The links provided are just to get an understanding of the topic, feel free to google and find specific examples