forName()

  • This method or function is present in Class class in Java. 
  • This method responsible for loding the argument whatever argument we pass, before creating the object of that argument.
  • Class.forName("com.mysql.jdbc.Driver"); if we write such a syntax means I am passing "com.mysql.jdbc.Driver" this argument to the forName() method.
  • From this we can say that before the creation of object of this argument load argument first.
  • If you still not understand watch this video.