Ask Question

When applying strict "Private access" level to a component. Which services should the designer provide in its class to allow the object to communicate with the outside world? What should be the access level of these services?

+5
Answers (1)
  1. 4 June, 15:52
    0
    public accessor methods

    Explanation:

    When applying strict "Private access" level to a component the designer should provide public accessor methods in its class to allow the object to communicate with the outside world. The access level of these services must be public so that they can be accessed by other classes and objects of the outside world.

    Below is an example of such a class design in java : -

    class MyClass {

    private int num; / /private class component

    public int getNum () { / /public accessor method to allow the object to communicate with the outside world

    return num;

    }

    }
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “When applying strict "Private access" level to a component. Which services should the designer provide in its class to allow the object to ...” in 📗 Computers & Technology 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