0

[DUPLICATE] What makes the difference between two (String[] args) and (String args[])?

When we will be using and why it has to be used? Any particular reason? Is this same while passing the arguments too?

30th Sep 2017, 10:09 AM
Elavarasi
Elavarasi - avatar
2 Answers
+ 10
@Elavarasi : Using (String[] args) states that args is an array of String while using (String args[]) states that args is an array of args. But that's programmatically wrong. Both can work the same way, yes, with arguments as well (with conditions applied).
30th Sep 2017, 10:37 AM
Dev
Dev - avatar
+ 9
Semantically, they are identical. However, I'd recommend using (String[] args) when declaring arrays. Its the more common practice. String args[] is compatible with C (programming language).
30th Sep 2017, 10:25 AM
Dev
Dev - avatar