convert array to set in java

convert array to set in java
/**
 * @author lautturi.com 
 * Java example: converting array to set in java
 */

import java.security.SecureRandom;
import java.util.*;

import com.google.common.collect.Sets;

public class Lautturi {

	public static void main(String[] args){

		Integer[] arr1 = {1, 3, 5, 2, 4};
		Set<Integer> set1 = new HashSet<Integer>(Arrays.asList(arr1));

		String[] arr2 = {"hello","lautturi","java","python","world","lau"};
		// with google guava
		Set<String> set2 = Sets.newHashSet(arr2);
		
		System.out.println("Set1:"+set1);
		System.out.println("Set2:"+set2);
		
	}
}
So‮w:ecru‬ww.lautturi.com

output:

Set1:[1, 2, 3, 4, 5]
Set2:[lau, python, java, world, lautturi, hello]
Created Time:2017-09-29 17:45:24  Author:lautturi