Results 1 to 11 of 11

Thread: What is Class.forName()?

  1. #1

  2. #2
    Registered
    Join Date
    May 2016
    Posts
    10
    A call to Class.forName("X") causes the class named X to be dynamically loaded (at runtime). A call to forName("X") causes the class named X to be initialized (i.e., JVM executes all its static block after class loading). Class.forName("X") returns the Class object associated with the "X" class. The returned Class object is not an instance of the "x" class itself.

  3. #3
    Registered
    Join Date
    Jul 2016
    Posts
    10
    A call to Class.forName("X") causes the class named X to be dynamically loaded (at runtime). A call to forName("X") causes the class named X to be initialized.

    web designing comapny

  4. #4
    Thoughtgrid Thoughtgrid's Avatar
    Join Date
    Jul 2016
    Location
    Bangalore
    Posts
    219
    This will given fully qualified name of class,this method attempts locate,load and link the class, this function succeed reference to the class object for class if it fails class not found exception thrown this is an main process of an Class.for Name() function.

  5. #5
    The java.lang.Class.forName(String name, boolean initialize, ClassLoader loader) method returns the Class object associated with the class or interface with the given string name, using the given class loader. The specified class loader is used to load the class or interface.

  6. #6
    The java.lang.Class.forName method returns the Class object associated with the class or interface with the given string name, using the given class loader. The specified class loader is used to load the class or interface.

  7. #7
    Junior Registered
    Join Date
    Dec 2016
    Posts
    8
    It is used to load the class and it also provides a new way for creating the instance of a class without using the "new" operator. We can use newInstance() to get the instance

  8. #8

  9. #9
    Registered
    Join Date
    Feb 2017
    Posts
    65
    forName() is used to load the class at runTime. when we could not decide which class to load

  10. #10
    Registered
    Join Date
    Jun 2017
    Posts
    24
    This method returns the class object representing the desired class.

  11. #11
    Registered
    Join Date
    Nov 2016
    Posts
    649
    The java.lang.Class.forName(String name, boolean instate, ClassLoader loader) strategy restores the Class protest related with the class or interface with the given string name, utilizing the given class loader. The predefined class loader is utilized to stack the class or interface.

Similar Threads

  1. Help with MBA Class Project (from hell?)
    By Celeste in forum General Promotion
    Replies: 1
    Last Post: 02-01-2009, 07:52 AM
  2. SMTPclient class in DotNet
    By smithcarvo in forum Website Programming & Databases
    Replies: 1
    Last Post: 09-15-2008, 06:28 AM
  3. Are multiple class C subnets still important?
    By paul in forum Web Hosting & Servers
    Replies: 6
    Last Post: 07-25-2007, 01:26 AM
  4. Javascript to change a link's css class
    By Chris in forum HTML, CSS, Layout, and Design
    Replies: 2
    Last Post: 11-18-2006, 02:38 PM
  5. Static inner class
    By joshuapaul in forum General Chat
    Replies: 0
    Last Post: 05-30-2006, 11:09 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •