ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip   SiteMap shows list of All Categories in this site.
Google
 
Categories  >>  Software  >>  Core Java  >>  Java J2EE  >>  Java Related
 
 


 

 
 Core Java interview questions  Core Java Interview Questions
 Advanced Java interview questions  Advanced Java Interview Questions
 Swing interview questions  Swing Interview Questions
 EJB interview questions  EJB Interview Questions
 Servlets interview questions  Servlets Interview Questions
 Struts interview questions  Struts Interview Questions
 JDBC interview questions  JDBC Interview Questions
 JMS interview questions  JMS Interview Questions
 SunOne interview questions  SunOne Interview Questions
 J2EE interview questions  J2EE Interview Questions
 Weblogic interview questions  Weblogic Interview Questions
 Websphere interview questions  Websphere Interview Questions
 Java Networking interview questions  Java Networking Interview Questions
 Java J2EE AllOther interview questions  Java J2EE AllOther Interview Questions
Question
when we write class.forName("any one class"); what happens 
actually?what it will return?explain stepwise?
 Question Submitted By :: Murali
I also faced this Question!!     Rank Answer Posted By  
 
  Re: when we write class.forName("any one class"); what happens actually?what it will return?explain stepwise?
Answer
# 1
When we user Class.forName("any one class"); in out program 
then actually we tell to JVM to load this class for 
connectivity to the DB with out program.
 
Is This Answer Correct ?    2 Yes 0 No
Raviji
 
  Re: when we write class.forName("any one class"); what happens actually?what it will return?explain stepwise?
Answer
# 2
Class.forName () takes the class name as parameter, and 
loads that class in memory. But it doesn't create any 
instance of that class.
 
Is This Answer Correct ?    1 Yes 0 No
Ram
 
 
 
  Re: when we write class.forName("any one class"); what happens actually?what it will return?explain stepwise?
Answer
# 3
why are you misguiding the people, class.forName("") create 
the instance of the class given as argument of the forName
().
first it will load the class in the JVM and after that it 
will create the instance.
 
Is This Answer Correct ?    0 Yes 1 No
Gaurav Agrawal
 
  Re: when we write class.forName("any one class"); what happens actually?what it will return?explain stepwise?
Answer
# 4
Class.forName("")loads that class in memory ,to create 
instance we have to use newInstance()

string _path="classpath loc of class XYZ ex com.aa.ss.XYZ";

Object ob=Class.forName(_path).newInstance();;
((XYZ)ob).any_method_of_XYZ();
 
Is This Answer Correct ?    1 Yes 0 No
Paras
 
  Re: when we write class.forName("any one class"); what happens actually?what it will return?explain stepwise?
Answer
# 5
When Class.forNmae("className") is executed, the class will 
be loaded, as soon as the class is loaded the static block 
will be executed.In the static block the thngs will happen.
 
Is This Answer Correct ?    0 Yes 0 No
Raghu
 

 
 
 
Other Core Java Interview Questions
 
  Question Asked @ Answers
 
Hi, This is ravi i have a question like this i have string "UNDERSTAND" now i want to count the letters how many times it occures.i.e from the above string the out put should be like this U-1,N-2,D-2,E-1,R-1,S-1,T-1,A-1. how can i achieve this Thnaks in advance for your response ..  4
int a=1; float b=1.0; System.out.println(a==b); Honeywell8
what is j2se  3
1).what is the difference between below examples String s="vijay"; String s=new String("vijay"); TCS11
What are the OOPS concepts in Java ? Satyam3
Can you call a private data from an inner class?  3
What is the difference between getCodeBase and getDocumentBase methods?  1
How does a try statement determine which catch clause should be used to handle an exception?  2
What modifiers are used with a top level class?  2
What enableEvents() method do?  1
What is a stream? what are the different types and classes of Streams?  2
Why Java is not purely object oriented? Persistent21
What method is used to compare two strings ?  4
Hi buddy, well i got that there is always a default constructor with abstract class. OK. But why not with interface? Thanks in advance.  2
byte a=5; byte b=5; byte c=a+b; System.out.println(c); whats the o/p? Wipro5
Program to output as below formate: 1 2 3 4 5 6 7 8 9 10 Huawei2
What is static binding and where it occurs?  2
what is overloading and overriding with example? CMC1
How to transfer data from an Applet to Servlet ?  1
what is difference between Action messages and Action errors? TCS1
 
For more Core Java Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com