Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Answer below questions about the Singleton: (2 points) One of the limitations of Singleton is sub classing any class can subclass the Singleton class and

Answer below questions about the Singleton: (2 points) One of the limitations of Singleton is sub classing any class can subclass the Singleton class and thus have access to its own instance because of inheritance sub class inherit the parent class , what do you think of this? Consider the following code to answer the following question: public class PrintDriver { private static final PrintDriver INSTANCE = new PrintDriver(); private PrintDriver() {} public static PrintDriver getInstance() { return INSTANCE;} } (2 point) which type of initialization is used in the code? What is issue of this type of initialization? (2 points) Is the singleton in the above code thread-safe? Explain your answer? (4 points) Rewrite the code to make it thread-safe using double-check locking?

Hasan sent Today at 9:22 AM

-You are implementing a simple file system for an operating system for managing files and folders; similar to Windows or UNIX. Your design should follow the following guidelines i) The entire file system is represented by an object which is the reference to the root folder ii) Any folder in the file system may contain two types of items, folders (subfolder) and files and you want to treat both in the same way iii) possible operations: getName, getPermission, listItem (1 point) What is the most appropriate design pattern? (3 points) Draw the class diagram, and make it clear what are the main components and what are their roles, and show the relationship between classes? (6 points) write code of the main components in your design?

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Relational Database And Transact SQL

Authors: Lucy Scott

1st Edition

1974679985, 978-1974679980

More Books

Students also viewed these Databases questions