public static String getClassPackageName ( Class c ) { String s = c . getName ( ) ; int i = s . lastIndexOf ( ' ' ) ; return ( i < 0 ) ? null : s . substring ( 0 , i ) ; }
Returns the package name of the class given .