0

I was reading a bit about the JDBC, i've made a lot of programs related to JDBC, but i've never been able to understand the concept of Class.forName().
Please explain it fully, i know the basics, as what are the strings passed, what is done and all. I wanna know the working of not only forName method but also the class CLASS.
PLEASE HELP

2
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by arshi9464
1

An instance of the Class class represents a class in your program. Using that instance you can find and access all the attributes of that class (variables, methods, annotations etc etc). Its used as part of Java reflection (that's the keyword to Google), which is used to find out the attributes of a class at runtime because you don't know them at compile time.
Here's a good place to start
http://download.oracle.com/javase/tutorial/reflect/index.html

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.