What is the use of Class.forName

Answer Posted / vivek katta

Class.forName will basically load a class. As part of class loading, static variables
will be initialized and static blocks present in the class will be executed.

This is the concept used in JDBC to register driver(s). A static block in the driver
class gets executed which inturn registers the JDBC driver with the connection
manager.

Is This Answer Correct ?    66 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are externizable interface?

671


How to implement dphibernate to activate lazy loading in Flex with java ?thanx in advance!

2657


What are the different approaches to represent an inheritance hierarchy?

681


How will you pass parameters in RMI? Why do you serialize?

798


What if the static modifier is removed from the signature of the main method?

831






What method is invoked to cause an object to begin executing as a separate thread?

662


What are callback interfaces?

686


What is a session? Can you share a session object between different theads?

634


What’s jboss cache in short?

705


Which class is the immediate superclass of the menucomponent class?

731


What is ioc concept & explain it?

702


Which container method is used to cause a container to be laid out and redisplayed?

748


Define aop(assepct oriented programing)?

739


Can I run seam outside of jboss as?

722


What is a clone?

653