/**
 * This program prints arguments passed in the output screen.
 */
public class MyApp
{
    public static void main(String[] args)
    {
        System.out.println("Argument Length : "+args.length);
        
        if (args.length == 0)
        {
            System.out.println("No arguments passed");  
        }
        else
        {
            for (String arg : args)
            {
                System.out.println(arg);
            }
        }
    }
}
 
Output
Argument Length : 3
peter
john
juli
Click the below Image to Enlarge
|  | 
| Java Tutorial : The Main method | 
|  | 
| Java Tutorial : The Main method | 
|  | 
| Java Tutorial : The Main method | 
|  | 
| Java Tutorial : The Main method | 
|  | 
| Java Tutorial : The Main method | 
|  | 
| Java Tutorial : The Main method | 
|  | 
| Java Tutorial : The Main method | 
|  | 
| Java Tutorial : The Main method | 
To Download DisplayAllHeadersApp Project Click the below link 
No comments:
Post a Comment