package com.tutego.insel.meta;

import java.util.*;

class CheckClassType
{
  public static void main( String[] args )
  {
    Class<?> observer = Observer.class;
    Class<?> observable = Observable.class;
    Class<?> array = (new int[2][3][4]).getClass();
    Class<?> primitive = Integer.TYPE;
    
    checkClassType( observer );
    checkClassType( observable );
    checkClassType( array );
    checkClassType( primitive );
  }

  static void checkClassType( Class<?> c )
  {
    if ( c.isArray() )
      System.out.println( c.getName() + " is an array." );
    else if ( c.isPrimitive() )
      System.out.println( c + " is a primitive type.");
    else if ( c.isInterface() )
      System.out.println( c.getName() + " is an interface." );
    else
      System.out.println( c.getName()+ " is a class." );
   }
}
