| Author |
Re:Class.forName()
|
Sujith Kanaparthi
Ranch Hand
Joined: Sep 04, 2005
Posts: 45
|
|
Hi , I have a query.The function forName(String className) of java.lang.Class returns class object associated with the given string.Every return type must be caught.But if I write a programm such as public class Demo{ public static void main(String arg[]){ Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");//this function returns class object /* code to manipulate database */ } } Eventhough I have not caught the returned class object,like Class m = Class.forName("sun.jdbc.odbc.JdbcOdbcDriver")), the program is working fine.I just want to know how is this possible and why is this happening?.Please clarify my doubt. Regards, Sujith
|
 |
Paul Sturrock
Bartender
Joined: Apr 14, 2004
Posts: 10336
|
|
|
Please don't cross post.
|
JavaRanch FAQ HowToAskQuestionsOnJavaRanch
|
 |
 |
|
|
subject: Re:Class.forName()
|
|
|