Which is the java equivalent of c#
this.GetType().Namespace
to get the package name in which the class is contained?
Which is the java equivalent of c#
this.GetType().Namespace
to get the package name in which the class is contained?
This is the package of a class:
Package myPackage = getClass().getPackage();
// or from a static context:
Package myPackage = MyClass.class.getPackage();
as a String:
String packageName = getClass().getPackage().getName();
// or from a static context:
String packageName = MyClass.class.getPackage().getName();