Created
March 24, 2015 15:43
-
-
Save chrisyeung1121/fda7ce5ca5edb2a615b6 to your computer and use it in GitHub Desktop.
Characters Array v.s. String Array
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String[] stringArray = {"a", "b", "c"}; // Compile okay | |
String[] stringArray2 = {'a', 'b', 'c'}; // single quotation is for Character Class | |
Character[] charArray = {'a', 'b', 'c', 'd'}; // Compile okay | |
Character[] charArray2 = {"a", "b"}; // Error: Double quotation is parsed as String | |
Character[] charArray3 = {'ab'}; // Error: Too many characters. Can only have one. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment