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 use of predicate in java 8?
Is nan false?
What are the differences between string, stringbuffer and stringbuilder?
What do you understand by Header linked List?
Can a class have multiple superclasses?
How can you make sure that your singleton class will always return single instance in multi-threaded environment?
What is computer compiler?
Does it matter in what order catch statements for filenotfoundexception and ioexception are written?
What are runtime exceptions?
What is numeric data type?
What is the difference between a method and a function in alice?
What is meant by null and void?
Define an abstract class with reference to java.
What is the difference between class forname and new?
Why is java called the platform independent programming language?