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

What is an escape syntax?

543


What are the different types of JDBC drivers?

630


What is jdbc class forname?

497


What are the new features added to JDBC 4.0?

547


What is the significance of DataBaseMetaData.tableIndexStatistics? How to obtain and use it?

523






Is jdbc a web technology?

504


What are database warnings in jdbc and how can we handle database warnings in jdbc?

624


What are clob and blob data types in jdbc?

579


What are the different types of statements in jdbc?

501


Which type of driver is unique in jdbc?

498


Explain different types of locks in jdbc?

527


What is thin driver in jdbc?

516


What is jdbc and its types?

505


What is the use of JDBC DriverManager class?

568


What is SQL Warning? How to retrieve SQL warnings in the JDBC program?

558