Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    public static String extractPackageName(String className) {
        int lastPoint = className.lastIndexOf(".");
        if (lastPoint >= 0) {
            return className.substring(0, lastPoint);
        } else {
            return "";
        }
    }
}