#24 known is a drop! main method in JAVA

java dev.to

Q1: Why String args[] as parameter in main()? String args are called command line arguments in the form of arrays. These are used to give input during run time. Actually not during run time, before the program runs itself ,we give input. In cmd prompt: eg: java filename input1 input2 🟩input1 is stored in args[0],input2 is stored in args[1]. 🟩all inputs are taken in the form of Strings. 🟩 if we want to perform any arithmetic operations, we have

Read Full Tutorial open_in_new
arrow_back Back to Tutorials