0

Can someone help to understand the difference,why is int in main and not in java

https://code.sololearn.com/clX0DhyR90fR/?ref=app, https://code.sololearn.com/cBt39gANtaoU/?ref=app

24th Aug 2021, 3:57 AM
Ajoh Pv
Ajoh Pv - avatar
8 Antworten
+ 2
Ajoh Pv Java runs on JVM and JVM can't do anything with returned value that's why main is void as void doesn't return anything.
24th Aug 2021, 4:53 AM
A͢J
A͢J - avatar
+ 2
Ajoh Pv exit () is a another method in System class which terminate JVM and return status to machine. So this method returns not main method returns. Using this method you are returning indirectly not directly. See the first statement of last answer.
29th Aug 2021, 12:45 PM
A͢J
A͢J - avatar
+ 1
Thank you
29th Aug 2021, 2:16 PM
Ajoh Pv
Ajoh Pv - avatar
0
Thank you all
24th Aug 2021, 6:23 AM
Ajoh Pv
Ajoh Pv - avatar
0
What is use of exit code
24th Aug 2021, 6:24 AM
Ajoh Pv
Ajoh Pv - avatar
0
A͢J - S͟o͟l͟o͟H͟e͟l͟p͟e͟r͟ with respect to last answer main returns output print so how it does not return anything
29th Aug 2021, 10:59 AM
Ajoh Pv
Ajoh Pv - avatar
0
String args[ ]? So all(integers) are in stored in strings? what is. string exactly?
29th Aug 2021, 3:22 PM
Ajoh Pv
Ajoh Pv - avatar