diff options
author | Adam Bard <github@adambard.com> | 2015-03-16 12:20:44 -0700 |
---|---|---|
committer | Adam Bard <github@adambard.com> | 2015-03-16 12:20:44 -0700 |
commit | cf342a04a13a8c2c9bbba62f975ea27c5b184730 (patch) | |
tree | 12a4bc007a2b2b130479337b601bd66d85bd69d5 /java.html.markdown | |
parent | bf73893f58a40565c858badcdcc74e47a46c75b7 (diff) | |
parent | 6034688980162cc5099dd2701b88e449182862f7 (diff) |
Merge pull request #1004 from themiurgo/patch-1
No-space array notation type[]
Diffstat (limited to 'java.html.markdown')
-rw-r--r-- | java.html.markdown | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/java.html.markdown b/java.html.markdown index ebe11bd3..10dd498c 100644 --- a/java.html.markdown +++ b/java.html.markdown @@ -103,15 +103,15 @@ public class LearnJava { // Arrays //The array size must be decided upon instantiation //The following formats work for declaring an array - //<datatype> [] <var name> = new <datatype>[<array size>]; + //<datatype>[] <var name> = new <datatype>[<array size>]; //<datatype> <var name>[] = new <datatype>[<array size>]; - int [] intArray = new int[10]; - String [] stringArray = new String[1]; - boolean boolArray [] = new boolean[100]; + int[] intArray = new int[10]; + String[] stringArray = new String[1]; + boolean boolArray[] = new boolean[100]; // Another way to declare & initialize an array - int [] y = {9000, 1000, 1337}; - String names [] = {"Bob", "John", "Fred", "Juan Pedro"}; + int[] y = {9000, 1000, 1337}; + String names[] = {"Bob", "John", "Fred", "Juan Pedro"}; boolean bools[] = new boolean[] {true, false, false}; // Indexing an array - Accessing an element |