Sapient Company Programming

Bob figured out that in his Java applications only one runtime enviroment is possible and that is actually true
Bob would like to make Runtime class a _______

1) Singleton class
2) Abstract class
3) Static classs
4) Final class

Read Solution (Total 2)

Sapient Other Question

In Which of the following situations is it best to use Singleton?

1) If an object has READ_ONLY state (all attributes are final)

2) If an obejct does not have any state (say, no attributes, only methods)

3) If an object has shared state (attributes are present, but those are modified by many of the other objects)

4) All of the given options
Bob is a software engineer and works of the Government of India. The government asks him to design a small ATM printing application. Which can generate multiple types of statements of the transcation including Mini statement. Detailed statement with minimized memory consumption. How would Bob accomplish this?

1) Bob would use Factory design pattern to generate multiple types of statements and Singleton design pattern for reducing memory consumption by creating a single instance of the StatementFactory class.

2) Bob would use Material design pattern to generate multiple types of statements and Singleton design pattern for reducing memory consumption by creating a single instance of the StatementFactory class.

3) Bob would use Singleton design pattern to generate multiple types of statements and Factory design pattern for reducing memory consumption by creating a single instance of the StatementFactory class.

4) None of the given options