get Package from object - Android java.lang.reflect

Android examples for java.lang.reflect:Package

Description

get Package from object

Demo Code


//package com.java2s;

public class Main {
    public static Package getPackage(Object obj) {
        final Class<?> cls = obj.getClass();
        return cls.getPackage();
    }//from   ww w  . j  a v  a 2s  .c o m
}

Related Tutorials