File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

is it a compile time error or runtime error?

 
Sudhakar Reddy Kurakula
Ranch Hand
Posts: 42
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
see this,

class.forName("driver class name");

if the driver class is not found,whether it gives compile time error or runtime error?


Cheers
Sudhakar
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is one of those questions where you might be quicker trying it yourself and seeing what happens.

If you read the JavaDocs for the forName(String) method of Class you'll see it throws a ClassNotFoundException if the class can't be found. However it takes a String, so it can only be at runtime the ClassLoader tries to load this.
[ December 11, 2006: Message edited by: Paul Sturrock ]
 
manish jha
Greenhorn
Posts: 7
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it is runtime error.
Because syntax wise the argument is of type String. It is syntactically passing String.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic