CS FundamentalsEasyWipro · Accenture pattern
Which design pattern ensures that a class has only one instance and provides a global point of access to it?
- A. Factory Method
- B. Singleton
- C. Observer
- D. Prototype
Correct answer: B. Singleton
Singleton restricts instantiation to one object (private constructor + static accessor). Prototype is the opposite idea: creating new objects by cloning.
Practise more Software Engineering, Git and Cloud Basics questionsSoftware Engineering, Git and Cloud Basics: notes and key points
More Software Engineering, Git and Cloud Basics questions
- Which SDLC model is built around repeated cycles in which an explicit risk analysis is done before each cycle's development?
- In the V-model, acceptance testing is planned against which development phase?
- How does beta testing differ from alpha testing?
- A black-box technique divides the input domain into classes whose members the program should treat the same way, then tests one value from…
- A control flow graph has 9 edges and 7 nodes and is a single connected component. What is its cyclomatic complexity?
- A REST client wants to change only the email field of an existing user resource without sending the whole resource. Which HTTP method fits…