C# 0 The Complete Reference


ISeries . Although the prefix  I



Download 4,07 Mb.
Pdf ko'rish
bet408/1096
Sana23.01.2022
Hajmi4,07 Mb.
#402171
1   ...   404   405   406   407   408   409   410   411   ...   1096
Bog'liq
C-Sharp 3 The Complete Reference Herbert Schildt

ISeries

. Although the prefix 



I

 is not necessary, many 

programmers prefix interfaces with 

I

 to differentiate them from classes. 



ISeries

 is 


declared 

public

 so that it can be implemented by any class in any program.

In addition to methods, interfaces can specify properties, indexers, and events. Events 

are described in Chapter 15, and we will be concerned with only methods, properties, and 

indexers here. Interfaces cannot have data members. They cannot define constructors

destructors, or operator methods. Also, no member can be declared as 



static

.

Implementing Interfaces

Once an interface has been defined, one or more classes can implement that interface. To 

implement an interface, the name of the interface is specified after the class name in just 

the same way that a base class is specified. The general form of a class that implements an 

interface is shown here:

class

class-name

 : 


interface-name

 {

    // class-body



}

The name of the interface being implemented is specified in 



interface-name.

 When a class 

implements an interface, the class must implement the entire interface. It cannot pick and 

choose which parts to implement, for example.

A class can implement more than one interface. When a class implements more than one 

interface, specify each interface in a comma-separated list. A class can inherit a base class 

and also implement one or more interfaces. In this case, the name of the base class must 

come first in the comma-separated list.

www.freepdf-books.com



Download 4,07 Mb.

Do'stlaringiz bilan baham:
1   ...   404   405   406   407   408   409   410   411   ...   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