Array of strings in main - Java Language Basics

Java examples for Language Basics:Array

Description

Array of strings in main

Demo Code

public class Main {
    public static void main(String[] args) {
        int indexMin = 0;
        for (int i = 1; i < args.length; i++)
            if (Integer.parseInt(args[indexMin]) > Integer.parseInt(args[i]))
                indexMin = i;/*from   w  w  w . j a va 2  s.c o  m*/

        System.out.println("Maximum argument found at index:" + indexMin + " :" + args[indexMin]);
    }

}

Related Tutorials