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

How to test jdbc connection to sql server?

492


Why jdbc is used in java?

473


What is database connection pooling? Advantages of using a connection pool?

528


What is jdbc odbc bridge in java?

530


How the JDBC application works?

523






What is jdbc driver?

453


What is the purpose of jdbc resultset interface?

562


What is a statement in java?

506


How vendor Naming registry supports JNDI?

1759


What is a jdbc connection?

466


What is jdbc and jpa?

507


What is connection data?

470


What are the basic exceptions in jdbc?

516


What is jdbc stand for?

483


What is the different between ResultSet and RowSet?

533