Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    /**
     * Returns the package name part of an dot-qualified class name.
     *
     * @param qualifiedName  qualified class name
     * @return  package name
     */
    public static String getPackageName(String qualifiedName) {
        int index = qualifiedName.lastIndexOf('.');
        return index < 0 ? "" : qualifiedName.substring(0, index);
    }
}