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
How many objects are created for a singleton class
 Question Submitted By :: Srinivasa
I also faced this Question!!     Rank Answer Posted By  
 
  Re: How many objects are created for a singleton class
Answer
# 1
one
 
Is This Answer Correct ?    2 Yes 0 No
Pushpa
 
  Re: How many objects are created for a singleton class
Answer
# 2
Is a design pattern that is used to restrict instantiation 
of a class to one object.
 
Is This Answer Correct ?    2 Yes 0 No
Chaman
 
 
 
  Re: How many objects are created for a singleton class
Answer
# 3
The Singleton is a useful Design Pattern for allowing only 
one instance of your class.The Singleton's purpose is to 
control object creation, limiting the number to one but 
allowing the flexibility to create more objects if the 
situation changes. Since there is only one Singleton 
instance, any instance fields of a Singleton will occur 
only once per class, just like static fields.

 

 
Is This Answer Correct ?    3 Yes 0 No
Rajani Nagandla
 
  Re: How many objects are created for a singleton class
Answer
# 4
in clustered environment singletons will have as many instances as JVMs
 
Is This Answer Correct ?    0 Yes 1 No
Suresh Solomon
 

 
 
 
Other Core Java Interview Questions
 
  Question Asked @ Answers
 
public class AboutStrings{ public static void main(String args[]){ String s1="hello"; String s2="hel"; String s3="lo"; String s4=s2+s3; //to know the hash codes of s1,s4. System.out.println(s1.hashCode()); System.out.println(s4.hashCode()); // these two s1 and s4 are having same hashcodes. if(s1==s4){ System.out.println("s1 and s4 are same."); }else System.out.println("s1 and s4 are not same."); } } Somebody told me that, == operator compares references of the objects. In the above example even though s1 and s4 are refering to same object(having same hash codes), it is printing s1 and s4 are not same. Can anybody explain in detail why it is behaving like this? Thanks in Advance RavuriVinod TCS3
what do you meant by Platform-Independent? Persistent4
What is the difference between static and non-static variables?  2
What services that container provides?  1
What is Map interface? Wipro2
Where the CardLayout is used?  1
What are different types of Exceptions?.  5
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
What is run-time class and system class? what is their purpose?  1
How to set the Heap size in Java ? HCL2
is java support call by reference and call by value, if supports please explain?  3
In the first round, there are 30 aptitude and 30 java questions. We are suppose to finish both the papers within 60 minutes. I cleared this round. Next was test for programming skills. In this section, Some 7 n's were asked. 1. What is the difference b/w sleep(1000) and wait(1000) 2. what is the diff b/w static block and static function? 3. Write a program to validate IP address using string tokenizer. 4. Write a program to create singleton class 5. write a function to reverse the string 6. Write a prog to print prime nos upto n. EX: If n=9, It shld print 1,2,3,5,7 7. One program on collections- Write a program to print no. of times a number is repeating in an array. EX- {1,3,1,2,5,7,3,7,34,3,8,3} It should print: 1- 2 times 3- 4 times and so on 7. Write a func to print fibonocci series After this I had technical interview, which went on for. 60 mins or so. There were qn's about multi threading, Exception handling and collection classes. Knowledge about collections was very important for the post I was interviewed for. Huawei1
How to declare unique ArrayList ? RMSI4
How are this() and super() used with constructors?  4
I have a Person object with 5 variables and I want to store them in a file called Person.txt. What should I do? KPIT3
Explain pass by reference and pass by value? Wipro5
What is AppletStub?  1
What is more advisable to create a thread, by implementing a Runnable interface or by extending Thread class?  5
Hi Friends, can you give difference between extending thread class and implementing runnable interface.  2
how can u create the object with out new operator  2
 
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