/* Simple Java Program that uses Command line arguments as input */
class ComandLine
{
public static void main(String args[])
{
int count, i = 0;
String string;
count = args.length;
System.out.println("Number Of Arguments : "+count);
while(i< count)
{
string = args[i];
i = i + 1;
System.out.println(i+ " : "+"Java Is "+string+ "!");
}
}
}
/* *Compile and run the command line as follows *Java Commandline Simple Object_Oriented Distributed Robust Secure Portable Multithread Dynamic */
/*** OUTPUT ***
As Seen on Java E:\Java\bin>javac Commandline.java
E:\Java\bin>java ComandLine Simple Object_Oriented Disrtibuted Robust Secure por
table Multithread dynamic
Number Of Arguments : 8
1 : Java Is Simple!
2 : Java Is Object_Oriented!
3 : Java Is Disrtibuted!
4 : Java Is Robust!
5 : Java Is Secure!
6 : Java Is portable!
7 : Java Is Multithread!
8 : Java Is dynamic!
*/
Labels: Core Java
Subscribe to:
Post Comments (Atom)
Post a Comment