Java examples for Language Basics:int
Reporting the lexicographically minimum string of the command line arguments
public class Main { public static void main(String[] args) { String minimum = args[0];// w ww. java 2 s .com for (int i = 1; i < args.length; i++) if (minimum.compareTo(args[i]) > 0) minimum = args[i]; System.out.println("Lexicographically minimum string is:" + minimum); } }