[java] Default argument values and array sizes.

Started by
3 comments, last by Lucidquiet 19 years, 7 months ago
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-
"Education is when you read the fine print; experience is what you get when you don't." -Pete Seegerwww.lucid-edge.net
Advertisement
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-
"Education is when you read the fine print; experience is what you get when you don't." -Pete Seegerwww.lucid-edge.net
Java does not support default values for method calls.
"None of us learn in a vacuum; we all stand on the shoulders of giants such as Wirth and Knuth and thousands of others. Lend your shoulders to building the future!" - Michael Abrash[JavaGaming.org][The Java Tutorial][Slick][LWJGL][LWJGL Tutorials for NeHe][LWJGL Wiki][jMonkey Engine]
Thanks capn' that what I wanted to hear.
"Education is when you read the fine print; experience is what you get when you don't." -Pete Seegerwww.lucid-edge.net

This topic is closed to new replies.

Advertisement