Question : using java reflection to get class package and  imported pakages

Hi Experts,

I need to use java reflection to get all imported packages as well as the class package of java class file


e.g. lets say I have the following java class:

package org.hjk.ops;

import org.xx.yy;  // used for param1
import org.ss.zz;   // used for param2

public class Calcul  {
  private yy yyObj;
  private xx xxObj

  /**
   * Initialisation du calcul.
   */
  public Calcul(yy yyObj, xx xxObj) {
    // DO STHG HERE
  }
}


and let s say I only have the .class file :

So I need to use java reflection to get the following:

- org.hjk.ops
-org.xx.yy
-org.ss.zz

Answer : using java reflection to get class package and  imported pakages

Random Solutions  
 
programming4us programming4us