Java Class Simple Name Get simpleClassName(Class klass)

Here you can find the source of simpleClassName(Class klass)

Description

simple Class Name

License

Apache License

Declaration

public static String simpleClassName(Class klass) 

Method Source Code

//package com.java2s;
/*//from  w  w  w .  j  a v a2 s. co m
 * Copyright 2001-2013 Geert Bevin (gbevin[remove] at uwyn dot com)
 * Licensed under the Apache License, Version 2.0 (the "License")
 */

public class Main {
    public static String simpleClassName(Class klass) {
        String class_name = klass.getName();
        if (klass.getPackage() != null) {
            class_name = class_name.substring(klass.getPackage().getName().length() + 1);
        }

        return class_name;
    }
}

Related

  1. simpleClassName(Class cl)
  2. simpleClassName(Class clazz)
  3. simpleClassName(Class clazz)
  4. simpleClassName(Class clazz)
  5. simpleClassName(Class type)