public static String classNameOnly(String cname){
  String s="[null object ref]";
  if (cname != null) {
    s=cname.substring(cname.lastIndexOf('.') + 1);
  }
  return s;
}

public static String classNameOnly ( String cname ) { String s = "[null object ref]" ; if ( cname != null ) { s = cname . substring ( cname . lastIndexOf ( '.' ) + 1 ) ; } return s ; }
given a string classname , returns just the classname with no package
