C# 0 The Complete Reference



Download 4,07 Mb.
Pdf ko'rish
bet178/1096
Sana23.01.2022
Hajmi4,07 Mb.
#402171
1   ...   174   175   176   177   178   179   180   181   ...   1096
Bog'liq
C-Sharp 3 The Complete Reference Herbert Schildt

AreaPerPerson( )

method, itself. The first line of 



AreaPerPerson( )

 is


public void AreaPerPerson() {

This line declares a method called 



AreaPerPerson

 that has no parameters. It is specified as 



public

, so it can be used by all other parts of the program. Its return type is 



void

. Thus, 


AreaPerPerson( )

 does not return a value to the caller. The line ends with the opening curly 

brace of the method body.

The body of 



AreaPerPerson( )

 consists solely of this statement:

Console.WriteLine("  " + Area / Occupants + " area per person");

This statement displays the area-per-person of a building by dividing 



Area

 by 


Occupants

.

Since each object of type 



Building

 has its own copy of 



Area

 and 


Occupants

, when 


AreaPerPerson( )

 is called, the computation uses the calling object’s copies of those 

variables.

The


AreaPerPerson( )

 method ends when its closing curly brace is encountered. This 

causes program control to transfer back to the caller.

www.freepdf-books.com




Download 4,07 Mb.

Do'stlaringiz bilan baham:
1   ...   174   175   176   177   178   179   180   181   ...   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