java checking variable object data type

java checking variable object data type
/**
 * @author lautturi.com
 * Java example: determine the object data type in java
 */

import java.util.*;

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

		Object[] mixedObjects = new Object[] { "Hello", true, 1, new StringBuilder("Hello there"), new String[10] };

		for (Object item : mixedObjects) {
			System.out.println(item.getClass().getSimpleName());
		}

	}
}
Sou‮ww:ecr‬w.lautturi.com

output:

String
Boolean
Integer
StringBuilder
String[]
Created Time:2017-09-02 22:09:01  Author:lautturi