GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Placement Papers  >  I-Flex  >  Technical
Go To First  |  Previous Question  |  Next Question 
 Technical  |  Question 24 of 27    Print  
how to make class as singleton pattern

  
Total Answers and Comments: 1 Last Update: January 19, 2007     Asked by: rekha 
  
 Sponsored Links

 
 Best Rated Answer
Submitted by: ghouse
 

Singleton class has only one instance, and to provide a global point of access to it.

ex

class Singleton
  {
  public:
      static Singleton* Instance();
  protected:
      Singleton();
      Singleton(const Singleton&);
      Singleton& operator= (const Singleton&);
  private:
      static Singleton* pinstance;
  };



Above answer was rated as good by the following members:
gr8shiney
January 18, 2007 17:19:57   #1  
ghouse        

RE: how to make class as singleton pattern

Singleton class has only one instance and to provide a global point of access to it.

ex

class Singleton
{
public:
static Singleton* Instance();
protected:
Singleton();
Singleton(const Singleton&);
Singleton& operator (const Singleton&);
private:
static Singleton* pinstance;
};


 
Is this answer useful? Yes | NoAnswer is useful 1   Answer is not useful 0Overall Rating: +1    

 Related Questions

EjbCreate() method of CMP bean returns (a) null (b) Primary Key class (c) Home Object (d) Remote Object
(a) Explanation: ejbCreate() method of BMP bean returns the Primary Key, where as ejbCreate() method of CMP bean returns null. 

(b) 
Latest Answer : Runnable Interface ...

(d) 
Latest Answer : The answer is all of the above, Stateful session beans contain Home interface, Remote interface, Bean class ...

A servlet implements Single Thread model public class BasicServlet extends HttpServlet implements SingleThreadModel { int number = 0; public void service(HttpServletRequest req, HttpServletResponse res) { } }

A method is defined in a class as : void processUser(int i) { } If this method is overriden in a sub class, (a) the new method should return int (b) the new method can return any type of values (c) the argument list of new method should exactly match that of overriden method (d) the return type of new method should exactly match that of overriden method

1. what are the different types of design patterns in core java ?2. what do we mean by value object design pattern ?
Read Answers (2) | Asked by : ranjan

Latest Answer : Singleton class has only one instance, and to provide a global point of access to it.ex class Singleton   {  public:      static Singleton* Instance();  protected:      Singleton();      ...
Read Answers (1) | Asked by : rekha

Latest Answer : File f = new File(""); f.length(); ...
Read Answers (1) | Asked by : raga

1.What will be the output?boolean a = false if (a=true){ System.out.ptinln("Hello");}else{ System.out.ptinln("GoodBye");}2. Hashmap , hashset , ArrayList(true, true, false)3.Which need 
Latest Answer : answer is true ...
Read Answers (2) | Asked by : Vartika


 Sponsored Links

 
Related Articles

jQuery Three-color Alternating Pattern

Learning jQuery Three color Alternating Pattern There may be times when we want to apply more complex striping For example we can apply a pattern of three alternating row colors rather than just two To do so we first need to define another CSS rule for the third row We ll also reuse the odd and even
 

C++ Pure Virtual Function and Base Class

C Pure Virtual Function and Virtual Base Class In this C tutorial you will learn about pure virtual function declaration of pure virtual function and virtual base class virtual base class and how to implement a virtual base class explained with examples mosgoogle center What is Pure Virtual Function
 

How to Access C++ Class Members

How to Access C Class Members In this C tutorial you will learn how to access Class members dot operator or class member access operator difference between struct and class and  scope resolution operator mosgoogle center It is possible to access the class members after a class is defined an
 

Data Warehouses Non Technical Issues

Data Warehouses Non Technical Issues When companies get ready to implement a data warehouse few of them pay attention to the political issues that may surround it It must be emphasized that politics can reduce the chances for success with a data warehouse project and I want to warn companies against
 

UML Elements : Class Diagram

UML Elements UML 2 0 is comprised of a total of 13 diagrams If you wish to understand these diagrams they should be organized based on a hierarchy For UML a diagram is an element which must define which things should be modeled in a system mosgoogle center Introduction to Class Diagram In this arti
 

Technical Aspects of CRM

Technical Aspects of CRM While it must be emphasized that CRM is not a technology there are a number of technical issues that need to be considered when a company decides to implement a CRM system The first technical issue that needs to be analyzed is scalability In a nutshell the CRM system must be
 

Class-based Object Oriented Programming

Class based Object Oriented Programming Class based object oriented programming is a style that gains inheritance by processing classes as objects The most prominent style of OOP is class based instead of object based With the class based OOP system objects are units that merge states identities and
 

Class Constructors and destructors in C++

Class Constructors and destructors in C In this C tutorial you will learn about Class Constructors and destructors in C viz Constructors What is the use of Constructor General Syntax of Constructor Destructors What is the use of Destructors and General Syntax of Destructors mosgoogle Constructors Wh
 

A Java TOC2 Class Which Can Contact Aim

How To Produce a Java TOC2 Class Which Can Contact Aim AOL Instant Messenger is one of the most popular instant messenging tools available today It allows you to send instant messages to other people who use AIM At the same time it is possible to heavily customize AIM programs by using a protocol wh
 

How To Perform Class Loading With Java

How To Perform Class Loading With Java The class loading system for Java is both flexible and strong It will allow your programs to gains access to class databases without having to link to include" files which are static It will load archive files which contain these classes and other to
 

About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape