In Java, why do you put parentheses before the aray name?

I was told

int[] numbers

and

int numbers[]

Is equivalent I've only seen the former If so, what is the motivation for writing down the latter?

Solution

It's really important, but my personal preference is the int [] number because it logically follows the class instance_ Name mode

After all, you are really studying an "array of integers" called "numbers". The second form is a bit misleading because it claims that "integers" are called "numbers" more. By the way, it is actually an "array of numbers"

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>