C++ Neural Networks and Fuzzy Logic: Preface



Download 1,14 Mb.
Pdf ko'rish
bet40/443
Sana29.12.2021
Hajmi1,14 Mb.
#77367
1   ...   36   37   38   39   40   41   42   43   ...   443
Bog'liq
C neural networks and fuzzy logic

Data Hiding

Related to the idea of encapsulation is the concept of data hiding. Encapsulation hides the data from other

classes and functions in other classes. Going back to the ElectronicBook class, you could define functions

like GetNextPage, GetPreviousPage, and GetCurrentPage as the only means of accessing information in

the ArrayofPages data member, by functions that access the ElectronicBook object. Although there may be a

hundred and one other attributes and data elements in the class ElectronicBook, these are all hidden from

view. This makes programs more reliable, since publishing a specific interface to an object prevents

inadvertent access to data in ways that were not designed or accounted for. In C++, the access to an object,

and its encapsulated data and functions is treated very carefully, by the use of keywords private, protected,

and public. One has the opportunity to make access specifications for data objects and functions as being

private, or protected, or public while defining a class. Only when the declaration is made as public do other

functions and objects have access to the object and its components without question. On the other hand, if the

declaration happens to be as private, there is no possibility of such access. When the declaration given is as

protected, then the access to data and functions in a class by others is not as free as when it is public, nor as

restricted as when it is private. You can declare one class as derived from another class, which will be

discussed shortly. So−called derived classes and the declaring class do get the access to the components of the

object that are declared protected. One class that is not a derived class of a second class can get access to data

items and functions of the second class if it is declared as a friend class in the second. The three types of

declarations of access specification can be different for different components of an object. For example, some

of the data items could be declared public, some private, and the others protected. The same situation can

occur with the functions in an object. When no explicit declaration is made, the default specification is as

private.


Previous Table of Contents Next

Copyright ©

 IDG Books Worldwide, Inc.

C++ Neural Networks and Fuzzy Logic:Preface

Data Hiding

31




Download 1,14 Mb.

Do'stlaringiz bilan baham:
1   ...   36   37   38   39   40   41   42   43   ...   443




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish