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?
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).
+ 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).