Java check if object is string type object

Java check if object is string type object
/**
 * @author lautturi.com
 * Java example: check whether object is a string
 */

import java.util.*;

public class Lautturi {
	public static void main(String[] args) {
		
		Object foo = "";

		if( foo instanceof String ) {
			System.out.println("It's String type");
		}

	}
}
Source:ww‮ual.w‬tturi.com
Created Time:2017-09-02 21:53:07  Author:lautturi