C# 0 The Complete Reference



Download 4,07 Mb.
Pdf ko'rish
bet71/1096
Sana23.01.2022
Hajmi4,07 Mb.
#402171
1   ...   67   68   69   70   71   72   73   74   ...   1096
Bog'liq
C-Sharp 3 The Complete Reference Herbert Schildt

A Small Variation

Although all of the programs in this book will use it, the line

using System;

at the start of the first example program is not technically needed. It is, however, a valuable 

convenience. The reason it’s not necessary is that in C# you can always 

fully qualify

 a name 


with the namespace to which it belongs. For example, the line

Console.WriteLine("A simple C# program.");

can be rewritten as

System.Console.WriteLine("A simple C# program.");

Thus, the first example could be recoded as shown here:

// This version does not include "using System;".

class Example {

www.freepdf-books.com




PART I

C h a p t e r   2 :  

A n   O v e r v i e w   o f   C #  

23

PART IPART I



  // A C# program begins with a call to Main().

  static void Main() {

    // Here, Console.WriteLine is fully qualified.

    System.Console.WriteLine("A simple C# program.");

  }

}

Since it is quite tedious to always specify the 



System

 namespace whenever a member 

of that namespace is used, most C# programmers include 

using System

 at the top of their 

programs, as will all of the programs in this book. It is important to understand, however, 

that you can explicitly qualify a name with its namespace if needed.




Download 4,07 Mb.

Do'stlaringiz bilan baham:
1   ...   67   68   69   70   71   72   73   74   ...   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