Write a java program to accept an integer or string as command line argument and print whether the given input is string or integer
Sample Input (Command Line Argument) 1:
abc
Sample Output 1:
The given input is a string
Sample Input (Command Line Argument) 2:
5
Sample Output 2:
The given input is an integer
Answers
Answered by
0
Answer:
The java command-line argument is an argument i.e. passed at the time of running the java program.
The arguments passed from the console can be received in the java program and it can be used as an input.
So, it provides a convenient way to check the behavior of the program for the different values. You can pass N (1,2,3 and so on) numbers of arguments from the command prompt.
Similar questions
Math,
6 months ago
Math,
6 months ago
English,
6 months ago
Political Science,
1 year ago
Math,
1 year ago