what does the method Class.forName returns?

Answer Posted / uv

When Class.forName("<classname>") function gets
executed,the class gets loaded in JVM.

To create an object and access its functions and variables,
we can use getInstance( ), please look into the below
fragment code:

Class c = Class.forName("Cls");
Object o = null;
o = c.getInstance( );
// type casting the Object
Cls cl = (Cls) o;

Is This Answer Correct ?    7 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we return resultset in java?

480


What is thin driver in jdbc?

514


What is the latest version of JDBC? What are the new features added in that?

529


Where is jdbc url mysql?

507


How do we load the drivers?

555






What is batch processing and how to perform batch processing in jdbc?

517


What are the jdbc statements?

563


How can you load the drivers?

556


What is encrypted connection?

504


What are the steps required to execute a query in jdbc?

534


What are 4 drivers available in JDBC? At what situation are four of the drivers used?

537


What are the different types of drivers under jdbc?

477


How do I start debugging problems related to the JDBC API?

528


What are different types of ResultSet?

590


Which is better odbc or jdbc?

507