Ask Question
9 June, 22:47

Which of the following statements is false? a. Another common use of private constructors is to force client code to use so-called "factory methods" to create objects. b. A factory method is a public static method that creates and initializes an object of a specified type (possibly of the same class), then returns a reference to it. c. One common use of a private constructor is sharing initialization code among a class's other constructors. d. You cannot prevent client code from creating objects of a class.

+1
Answers (1)
  1. 9 June, 23:01
    0
    Option D is false

    Explanation:

    You can prevent client codes from creating objects of a class by providing a single private constructor that consists entirely of static fields and methods for example

    public class Validation

    {private Validation () {} / / prevents instances / / static methods and fields go here}
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Which of the following statements is false? a. Another common use of private constructors is to force client code to use so-called "factory ...” in 📗 Business if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers