check if there are duplicate elements in java array

check if there are duplicate elements in java array
/**
 * @author lautturi.com
 * Java example: Java find out duplicate elements in array
 */

import java.util.*;
import java.io.File;

public class Lautturi {
	public static void main(String[] args) {

		String[] names = {"hello","lautturi","java"," python ","java","lau"};
		Set<String> set = new HashSet<String>();
		for (String name : names) {
		     if (set.add(name) == false) {
		    	 System.out.println(name + " is duplicate ");
		     }
		}
		
	}
}
S‮ecruo‬:www.lautturi.com

output:

java is duplicate
Created Time:2017-09-02 21:12:29  Author:lautturi