answersLogoWhite

0

What two functions of encapsulation?

User Avatar

Anonymous

14y ago
Updated: 8/18/2019

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?

Related Questions

If two switches each support all types of trunk encapsulation on a link between them which type of encapsulation will be negotiated?

12


What are two switching functions of a router?

The router encapsulates the packet in the appropriate data link frame type for the outgoing data link. The router determines the exit interface after data encapsulation.


Are accessor member functions a sign of poor class design?

No, accessor member functions are a sign of good class design, particularly in terms of data encapsulation.


What primary three functions does data link layer encapsulation provide?

* addressing * error detection * frame delimiting


What are the three primary functions provided by Layer 2 data encapsulation?

Primary functions provided by Layer 2 data encapsulation include data link layer addressing, and the detection of errors via cyclic redundancy check calculations. An additional function is delimiting groups of bits into frames.


What is the name of the process of building a frame around network layer information?

Encapsulation. Actually, this is one type of encapsulation; encapsulation occurs at several layers.Encapsulation. Actually, this is one type of encapsulation; encapsulation occurs at several layers.Encapsulation. Actually, this is one type of encapsulation; encapsulation occurs at several layers.Encapsulation. Actually, this is one type of encapsulation; encapsulation occurs at several layers.


What are two main components of data confidentiality?

encapsulation encryption


Can abstraction encapsulation be achieved in C program if yes explain?

abstraction and encapsulation is one of the concepts of OOPs and C is not an OOP [Object Oriented Programming language] obviously abst & encap will not be supported by 'C' Abstraction & encapsulation is a concept of OOP [Object Oriented Programming] But, 'C' is not an OOP whereas it is a POP [Procedure oriented programming], so obviously 'C' does not support abstraction and encapsulation Answer Encapsulation is not inherently supported but it can be emulated in C. The use of static and extern keywords for functions are almost equivalent to your private and public keywords in java (encapsulation). Read up more on those keywords.. Structures become an object's attributes while functions accepting pointers the the said struct become its methods.


What are oop functions?

1.genericity 2.polymorphism 3.objects and classes 4.data abstraction 5.data encapsulation 6.inheritence


What the functions of encapsulation?

a) Identifies pieces of data as part of the same communication b) Ensures that data pieces can be directed to the correct receiving end devices


What is different between inheritance and encapsulation?

wrapping up of data and function into a single unit is called encapsulation where polymorphism is the ability to take more than one form


What identifiers are added at the transport layer during the encapsulation process?

two applications communicating the data