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                      
Do you have a collection of Interview Questions and interested to share with us!!
Please send that collection to along with your userid / name. ThanQ
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
how can u create the object with out new operator
 Question Submitted By :: Ramanareddy333
I also faced this Question!!     Rank Answer Posted By  
 
  Re: how can u create the object with out new operator
Answer
# 1
As my opinion, we can create object of String using 2 ways:
 String s=new String("java"); 
 String s="java";

in Other way ,we can clone an object,that will create a 
new  copy of an object.

or using  Class.forName();( Not Sure....)
 
Is This Answer Correct ?    1 Yes 0 No
Bindhu
 
  Re: how can u create the object with out new operator
Answer
# 2
In 3 ways..
1)Using a Static Factory Method
ABC.getInstance();
2)Using newInstance() method...
class A=(A)Class.forName("A").newInstance();
3)Using clone() method.
 
Is This Answer Correct ?    2 Yes 0 No
Md. Abid Hossain
 
 
 

 
 
 
Other Core Java Interview Questions
 
  Question Asked @ Answers
 
we have two threads..both the threads are reading the data.. is there any need of synchronization there?...justify it? IBM4
what is generics in jdk1.5? Bally-Technologies1
What is yielding and sleeping? how they different?  2
what us Dyna action form? Aithent-Technologies3
What is the difference between array and arraylist? what is the difference between arraylist and linkedlist? EDS4
If you are reviewing the code of your team members, what points will you look at, assuming the performance of the application is not so great KPIT2
33. try { 34. // some code here 35. } catch (NullPointerException e1) { 36. System.out.print(”a”); 37. } catch (RuntimeException e2) { 38. System.out.print(”b”); 39. } finally { 40. System.out.print(”c”); 41. } What is the result if a NullPointerException occurs on line 34? 1 c 2 a 3 ab 4 ac  1
Catch(Exception e){ } in that what is Exception and purpose of that in that place exactly?  3
what is the difference between pagecontext and servletcontext? JBA-Infotech4
What is hypertext?  1
Which class is the immediate superclass of the Container class?  1
what is j2se  3
what is difference between class and object?  11
What is a super class and how super class be called?  3
Name the method that used to clear the buffer ?  2
Can you run the product development on all operating systems ?  1
What is the immediate superclass of Menu?  1
what is session facade ?  2
What is an array and a vector? How they different from each other?  3
In real time project which driver did u use? What is the main functionality of the Prepared Statement? Photon1
 
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