Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 879119
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T11:52:43+00:00 2026-05-15T11:52:43+00:00

Why I need to load the class definition like : Class.forName(ClassName); What is the

  • 0

Why I need to load the class definition like :

Class.forName(“ClassName”);

What is the need and advantage of this .Typically which is used to load driver class in JDBC.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T11:52:43+00:00Added an answer on May 15, 2026 at 11:52 am

    What is the need and advantage of this. Typically which is used to load driver class in JDBC.

    It allows you to build your applications so that key external dependencies are not compiled into the application source-code.

    For example, in the JDBC case, it allows you to switch between different driver implementations, and (in theory) different database vendors without changing your source code.

    Another use-case is when some supplier develops a generic form of an application with extension points that allow customers to “plug in” their own custom classes. The custom classes are typically loaded using Class.forName(...).

    A third use-case is application frameworks and containers which typically use Class.forName(...) under the hood to dynamically load the classes for application-specific beans, servlets, and so on.

    A fourth use-case is where the application (or more likely an application library) has modules that are not used in a typical application run. By using Class.forName(...) internally, the application or library can avoid the CPU and memory overhead of loading and initializing large numbers of unwanted classes. (The Sun Swing libraries apparently do this to reduce application startup times, and I’m sure there are other examples.)

    However, if you don’t need to be able to do this kind of thing, static dependencies are simpler to implement.

    FOLLOWUP

    But here ,while compile itself the “ClassName” parameter is known .So the key external dependency is compiled into application source-code??

    Nope. Obviously, that defeats the purpose. The application (or the framework) typically determines the names of the classes to be dynamically loaded from some configuration file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a class like this public class Definition { public virtual string Name
I need to load controller class and I try: App::import('Controller','AppController'); or App::import('Controller','PagesController'); But this
I need to use Java's Class.forName() to load one of my classes. Problem is
i have got <div><a class='link' href='index.php' data-container='target'>Load</a></div> <div class='target'></div> i need to write jquery
So, I need to make a method within a class protected from re-definition. I
Recently I've been doing things like this: import Tkinter class C(object): def __init__(self): self.root
I'm having some trouble reading JPEG files in my class. I need to load
I need to load data from a File which is located in HDFS and
I am working on a VB.Net project in which I need to load Nvidia's
I need to load a class in Symfony 1.4 but the simple placing of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.