
class Maxof2{
public static void main(String args[]){
//taking value as command line argument.
//Converting String format to Integer value
int i = Integer.parseInt(args[0]);
int j = Integer.parseInt(args[1]);
if(i > j)
System.out.println(i+" is greater than "+j);
else
System.out.println(j+" is greater than "+i);
}
} please compile and let me know the resolution

Hello Friend,
After compiling the code, while running the code, specify two arguments like this:
java Maxof2 4 5
The code take these values and check which is greater and display the output:
5 is greater than 4.
You can given any number as an argument.
Thanks
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.