C# 0 The Complete Reference


protected  in conjunction with  internal



Download 4,07 Mb.
Pdf ko'rish
bet573/1096
Sana23.01.2022
Hajmi4,07 Mb.
#402171
1   ...   569   570   571   572   573   574   575   576   ...   1096
Bog'liq
C-Sharp 3 The Complete Reference Herbert Schildt

protected

 in conjunction with 



internal

 to produce the 



protected internal

access modifier pair. The 



protected internal

 access level can be given only to class members. 

A member declared with 

protected internal

 access is accessible within its own assembly or 

to derived types.

Here is an example that uses 



internal

:

// Use internal.



using System;

class InternalTest {

  internal int x;

}

class InternalDemo {



  static void Main() {

    InternalTest ob = new InternalTest();

    ob.x = 10; // can access -- in same file

    Console.WriteLine("Here is ob.x: " + ob.x);

  }

}

Inside



InternalTest

, the field 



x

 is declared 



internal

. This means that it is accessible within 

the program, as its use in 

InternalDemo

 shows, but unavailable outside the program.

www.freepdf-books.com



17

Runtime Type ID, Reflection, 

and Attributes

T

his chapter discusses three interrelated and powerful features: runtime type 



identification, reflection, and attributes. 

Runtime type ID

 is the mechanism that lets 

you identify a type during the execution of a program. 

Reflection

 is the feature that 

enables you to obtain information about a type. Using this information, you can construct 

and use objects at runtime. This feature is very powerful because it lets a program add 

functionality dynamically, during execution. An 

attribute

 describes a characteristic of some 

element of a C# program. For example, you can specify attributes for classes, methods, and 

fields, among others. Attributes can be interrogated at runtime, and the attribute information 

obtained. Attributes use both runtime type identification and reflection.


Download 4,07 Mb.

Do'stlaringiz bilan baham:
1   ...   569   570   571   572   573   574   575   576   ...   1096




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