public static void main(String[] args) { String s = new String("foo"); if (s instanceof String) { System.out.print("s is a String"); } }