What will be output if we pass "10 20" as command line argument?
class CommandLineArg3
{
static public void main(String[] args)
{
System.out.println(args[0]+args[1]);
}
}
/*
Output:- 1020
Explanation:- Because within the main() method command line arguments are available in the form of
String and if add two strings then it will perform concatination operation instead of addition.
*/
{
static public void main(String[] args)
{
System.out.println(args[0]+args[1]);
}
}
/*
Output:- 1020
Explanation:- Because within the main() method command line arguments are available in the form of
String and if add two strings then it will perform concatination operation instead of addition.
*/
0 comments: