+ 1

[DUPLICATE] what does (String[] args) in 'void main (String[] args) ' means?

17th Jul 2016, 3:24 PM
KIRAN JOHNSON
KIRAN JOHNSON - avatar
5 Answers
+ 3
it's actually void main(String args[]) it's not that necessary. it basically declares an array of strings which can be taken as input in while calling main and used in the method
17th Jul 2016, 4:38 PM
Athul Krishna K P
+ 1
when we give input in cmd that time when u enter value of any data type it gets converted to string...but if u write int args[ ] ...it willl complie the code but. won't execute so conversion of any data any data type to string is. easy for compiler
17th Jul 2016, 4:38 PM
Yadnesh Kulkarni
Yadnesh Kulkarni - avatar
+ 1
its a main declare use method
17th Jul 2016, 5:01 PM
vinrosales
+ 1
main method
17th Jul 2016, 5:19 PM
vinrosales
0
it means that the main method can take an array of arguments which are usually passed in as cmdline arguments to your program. note that since they are defined as strings all arguments passed in will be represented as strings and you have to later on parse then and convert them to other types if you need to operate on them such as the case with numbers
22nd Jul 2016, 4:09 AM
Eric Gitangu
Eric Gitangu - avatar