in Education by
Which design pattern ensures that only one object of particular class gets created? (a) Singleton pattern (b) Filter pattern (c) State pattern (d) Bridge pattern This question was addressed to me during an interview. Query is from Design Patterns topic in section Java Beans & JDBC of Java Select the correct answer from above options JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
Right answer is (a) Singleton pattern To elaborate: Singleton pattern involves a single class which is responsible to create an object while making sure that only one object gets created. This class provides a way to access the only object which can be accessed directly without need to instantiate another object of the same class.

Related questions

0 votes
    Which of the below is not a valid design pattern? (a) Singleton (b) Factory (c) Command (d) ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 24, 2021 in Education by JackTerrance
0 votes
    Which of the below is not a valid classification of design pattern? (a) Creational patterns (b) Structural ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 24, 2021 in Education by JackTerrance
0 votes
    Which design pattern represents a way to access all the objects in a collection? (a) Iterator pattern (b ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 24, 2021 in Education by JackTerrance
0 votes
    Is design pattern a logical concept. (a) True (b) False The question was asked by my college ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 24, 2021 in Education by JackTerrance
0 votes
0 votes
    Which part of code gets executed whether exception is caught or not? (a) finally (b) try (c) ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 25, 2021 in Education by JackTerrance
0 votes
    Which of the following gets converted to DOM elements by the rendering engine? (a) Tokens (b) Strings ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 23, 2021 in Education by JackTerrance
0 votes
    How to get a particular value using the tagged name? (a) getElementbyID() (b) getElementsbyName() (c ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 23, 2021 in Education by JackTerrance
0 votes
    How do you add a particular state to the browsing history? (a) pushState() (b) replaceState() (c ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 23, 2021 in Education by JackTerrance
0 votes
    How to find the index of a particular string? (a) position() (b) index() (c) indexOf() (d ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 23, 2021 in Education by JackTerrance
0 votes
    How do you focus a particular part of the HTML page in JavaScript? (a) hover() (b) focus() (c ... , JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 23, 2021 in Education by JackTerrance
...