Check whether there are arguments when running a java program

https://w‮ual.ww‬tturi.com
Check whether there are arguments when running a java program
/**
 * @author lautturi.com 
 * Java example:Check if there are arguments while executing java program
 */

import java.util.*;
import java.time.LocalDate;

public class Lautturi {

	public static void main(String[] args) {
		System.out.println(args.length);
		if (args.length > 0) {
			// there are arguments

			// get the first argument
			System.out.println(args[0]);
		}
	}
}

Running the program:

java Lautturi/hello world

output:

1
world
Created Time:2017-09-25 01:03:07  Author:lautturi