Suppose there is an Online shopping cart application having
different objects like Cart, SelectionItem, Billing,
COnfiguration, Authentication, Authorization,
PersonalDetails etc. Out of this which one can be made a
singleton pattern and why?
Answer Posted / siddharth
With singleton design pattern we can ensure the following:
1) Only one instance on the class is created
2) Provide global point of access to the object.
example: printerspoolers
So in the above question configuration can be made a
singleton design pattern as configuration is same for
everyone
| Is This Answer Correct ? | 12 Yes | 1 No |
Post New Answer View All Answers
What is the static block?
What is java util function?
Why is it called a string?
What is the use of predicate in java 8?
Why collection doesn’t extend cloneable and serializable interfaces?
What is the impact of declaring a method as final?
What is preparedstatement in java?
how to create multithreaded program? : Java thread
What is indexof?
What is a two-pass assembler?
What is array list in java?
What is java oops?
What is the difference between char and char *?
What is the purpose of using bufferedinputstream and bufferedoutputstream classes?
Which method must be implemented by all threads?