I'm new to Java and I can't figure out what the difference between String[] and Array<String> is. And how do I actually count how many entries a String[] Array has?
Thanks!
3 Answers
String[] - is an array
Array - is a part of reflection API which you shouldn't bother about until you get more experience in java.
String[] a = new String[length]; - is a proper instantiation of array
a.length - returns length of the array
1 Comment
Force
I had to wait 10 Minutes before the system let me do that ;)
Array<String>? I can't find anyArray<T>class in the JDK reference, and my JDK'sjavacwon't let me compile anArray<String> foo;declaration. There'sArrayList<T>, but that's something else entirely.