Java - Write code to get Class Name From

Requirements

Write code to get Class Name From

Demo

//package com.book2s;

public class Main {
    public static void main(String[] argv) {
        String qualified = "abc.book2s.com";
        System.out.println(getClassNameFrom(qualified));
    }/* ww w.  j a  v a2 s.c o  m*/

    public static String getClassNameFrom(String qualified) {
        String name = qualified.replaceAll(".+?\\W", "");
        return name;
    }
}