This article explains, Program to demonstrate Command-Line to find the Largest number.
Program to demonstrate Command-Line to find Largest number.
SOURCE CODE .
class cmd
{
public static void main(String args[])
{
int a,b;
System.out.println("largest number: ");
a=Integer.parseInt(args[0]);
b=Integer.parseInt(args[1]);
if(a>b)
System.out.println("a is Greater :" +a);
else
System.out.println("b is Greater:" +b);
}
}
OUTPUT.
C:\A>javac cmd.java
C:\A>java cmd 12 34
largest number:
b is Greater:34
Also, View- Write a java program to create a window using swing.