[java] Default argument values and array sizes.
Is there a default value syntax for method parameters in java? I don't remember. And I'm not sure of this either, but I was wondering if there is syntax for specify the array size in a method declaration.
Sorry, I know this is a boring topic, but I'm working on java code reader tool. I've checked out the JLS and BNF diagrams, a few places and since this is really a simple question you'd think it would be in one of those resources, but I can't find it in unambiguous language.
Thanks for your help and time,
L-
Java does not support default parameter values, and the size of an array is not part of its type. (Keep in mind that when you pass it, all you pass is an array reference which might at different times point to different arrays of different sizes.)
Right, what I was thinking was that java might have hidden functionality array sizes. I understand that an array is an Object, that is a contnguous block of memory with the final agreggate being the array's length.
I suppose the question stems more from C++. Where the first
dimension's size must be passed. But then again all array sizes more or less must be passed.
I just wanted to make sure this wasn't some obscure aspect of java that I was overlooking in my code reader.
Thanks.
L-
I suppose the question stems more from C++. Where the first
dimension's size must be passed. But then again all array sizes more or less must be passed.
I just wanted to make sure this wasn't some obscure aspect of java that I was overlooking in my code reader.
Thanks.
L-
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement