answersLogoWhite

0

If you want maintainability, flexibility, and extensibility (and I guess, you do), your design must include encapsulation. How do you do that?

• Keep instance variables protected (with an access modifier, mostly private).

• Make public accessor methods, and force calling code to use those methods rather than directly accessing the instance variable.

• For the methods, use the JavaBeans naming convention of set and get.

User Avatar

Wiki User

14y ago

What else can I help you with?

Continue Learning about Engineering

What are the three methods of filing metal?

1st method-don't 2nd method-do 3rd method-it no joke it takes alot of time and is not fun at all


In what year does you robot take place?

The novel "I, Robot" takes place during different years, as its a collection of short stories. The first story "Robbie" takes place in 1996 (1982 in the original version). "Runaround" takes place in 2015, The rest of the short stories are never given dates, just general time frames. The "I, Robot" film takes place in 2035.


Write a method header for a method named find that takes a String and a double as parameters and returns an integer?

int find(String str, double d);


Climatology method is what?

The climatology method is another way of producing weather forecasts. It takes data over many years and compiles it to predict what type of weather will come.


What is data encapsulation in c plus plus?

Data encapsulation refers to a means of limiting data access only to those functions that actually require direct access. Object-oriented programming languages such as C++ use access specifiers (public, private and protected) to determine the accessibility (or visibility) of an object's data or, more specifically, its representation.Public member data is accessible to any function (no encapsulation).Private member data is accessible only to the class member functions and to friends of the class (full encapsulation).Protected member data is the same as private member data and is also accessible to implementers of derived classes and to friends of those classes (partial encapsulation).For most classes, data members are declared private, thus fully encapsulating the data.

Related Questions

How does ozone layer depletion take place?

Ozone layer depletion takes place on PSC's. These are frozen clouds.


Which layer is done by congestion control?

at the network layer, congestion control mechanism takes place


What takes place chemically in the ozone layer?

In the ozone layer, ozone relensihes. It is replenished by UV rays.


Where does most photosynthesis take place in?

Photosynthesis takes place in the chloroplasts found in the mesophyll layer.


Which layer does erosion take place?

The crust is the only place erosion takes place, primarily on the land surfaces.


What is the liquid called where this cycle takes place?

The liquid where the cycle of photosynthesis takes place is called chloroplast stroma.


Where the ozone layer takes place?

The ozone layer is present in the stratosphere. It is because of the perfect UV radiation and temperature to form ozone.


Where most photosynthesis takes place in the leaf?

Most photosynthesis takes place in the mesophyll cell layer of a leaf, specifically in the chloroplasts of these cells. The palisade mesophyll cells are particularly important for photosynthesis due to their high concentrations of chloroplasts and direct exposure to light.


What layer does of earths weather takes place?

Earth's weather primarily takes place in the troposphere, which is the lowest layer of the Earth's atmosphere. This layer extends up to around 10-15 kilometers above the surface and contains all the weather phenomena we experience, such as clouds, rain, and wind.


Where in a leaf does photosynthesis take place?

Photosynthesis takes place in the chloroplasts of a leaf, specifically in the cells of the mesophyll layer.


What layer of the earth does rain happen?

The layer of the atmosphere that most weather takes place in, is the troposphere. This layer is the lowest layer of the atmosphere.


What is the difference between cytokinesis in plant animal cell?

In plants cytokinesis occurs by the formation of cell plate which takes place by centrifugal method while in animals it occurs by the formation of cleavage furrow which takes place by centripetal method.