A more generic way, how to retrieve the name of the class (that is used in the program) that reflects the package name by using the getName() method. Here is an example that provides the proper way to use the getName() method.
Here we create an object of class Fclass and assign the reference of the class java.util.Integer.class to it. Now retrieve the class name (that is included in the program) by using the getName() method.
Here is the code of the Example :
Here is the output of the Example :
We have 1000s of tutorials on our website. Search Tutorials tutorials on our website.
Posted on: February 28, 2008 If you enjoyed this post then why not add us on Google+? Add us to your Circles