About Question enthuware.ocpjp.v7.2.1105 :
Posted: Tue Jun 02, 2015 10:55 pm
Here in this question, as well explained:
The number 2 "Add a private static...", this is not present on the code. So, the answer "Add a static method that returns an instance of SpeedSensor." will not be correct because, every time you will call this method, a new instance will be created and delivered to the client.1. Make the constructor of the class private so that no one can instantiate it except this class itself.
2. Add a private static variable of the same class to the class and instantiate it.
3. Add a public static method (usually named getInstance()), that returns the class member created in step 2.