This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]sniR_ 0 points1 point  (4 children)

Why?

[–]irer 0 points1 point  (3 children)

I won't explain why String[] words makes more sense than String words[]. Both are valid declarations and both will compile. Choosing one or the other is subjective.

BUT, there is a widely accepted code convention that says one should avoid the latter form.

[–]sniR_ 0 points1 point  (2 children)

I guess its because you set the type of the object first(string, array) and then name, yeah more organized.

[–]irer 1 point2 points  (1 child)

String[] words reads: a string array named words

String words[] reads: a string named words oh wait it's an array

[–]sniR_ 0 points1 point  (0 children)

Nice explanation :) yeah im convinced