Java tutorial
//package com.java2s; /** * <copyright> * Copyright (c) 2010-2012 Henshin developers. All rights reserved. * This program and the accompanying materials are made available * under the terms of the Eclipse Public License v1.0 which * accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * </copyright> */ public class Main { public static boolean instanceOfAll(Object o, Class<?>... clazzes) { for (Class<?> clazz : clazzes) if (!clazz.isInstance(o)) return false; return true; } }