Not sure you expressed yourself precisely as you wanted, but it is not exactly that. But you are right, that it is something to do with convention.Saed Hussein wrote:i saw that loops e.g for loop has array identifier convention like
Not sure I understand this part correctly (sorry if not), but if you meant to make method to have parameter as an array whose elements are integers, then yes, you're right, this is how you'd do.Saed Hussein wrote:so i would like to know array passing method convention suppose an array that accepts array of integers would be like this:
No, there are no strict convention. As mentioned earlier, important part is, that variable would be meaningful, not "a", or "dr" or similar.Saed Hussein wrote:i was thinking if there is a convention to use array variables in method inputs
Saed Hussein wrote:i was thinking if there is a convention to use array variables in method inputs.
I wish Oracle had maintained and updated those conventions.Roel De Nijs wrote:. . . Although there are (very old but still used) Code Convetions for the Java Programming Language. . .
Hope it helps!
Kind regards,
Roel
Saed Hussein wrote:so i would like to know array passing method convention suppose an array that accepts array of integers would be like this:
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Because they wanted to make a language looking like C++. It cuts both ways. Now we have crappy syntactic conventions whereby the following code will compile nicely and confuse all but the most experienced users:-On the other hand, the fact that C++ users thought the syntax looked familiar attracted them and contributed to the early popularity of Java®.Winston Gutkowski wrote:. . . DON'T use the second one. It's a throwback to C, and TBH I don't know why the Java authors ever decided to allow it. . . .
Winston Gutkowski wrote:There are two ways of defining arrays:
int[] array and
int array[]
My advice: DON'T use the second one. It's a throwback to C, and TBH I don't know why the Java authors ever decided to allow it.
No. No. No. No. Changed my mind. Wanna come down. To see this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
|