www.fatihkabakci.com

Personal Website and Computer Science TUR EN

C SHARP PROGRAMLAMA DILI

Last update: 10/7/2014 9:57:00 PM

Yazan:Fatih KABAKCI

C#(Sharp) programlama dili 2000'li yillarin basinda Microsoft tarafindan .NET platformu icin ortaya cikarilmis bir dildir.Bu dil Anders Hejlsberg liderliginde tasinabilirlik ve .Net alt yapisina uygun bir dil gelistirme amaciyla tasarlanmistir.

C# programlama dili Nesneye Dayali Programlama felsefesini daha onceden ortaya cikan C++ programlama dilinden almaktadir.C# ayni zamanda Java programlama dili ile de soz dizimi ve hedefleri dogrultusunda yakindan iliskilidir.Java'nin tasinabilirlik sorunlarina iliskin Bytecode cozumu C# dilinde de gorulmektedir.

Bir C# programi ilk kez derlenirken once yorumlanir.Yorumlanan kod Common Intermadiate Language,daha resmi ifade ile Microsoft Intermadiate Language adini almaktadir.Boylelikle ara forma yorumlanmis bir dil ortaya cikar.Bu cikan dil ise platform bagimsizligi modelini ortaya cikarmis olur.Yorumlanan bu ara dil bir JIT(Just In Time) derleyici ile derlenerek nihai dogal kod(native code) ortaya cikmis olur.
Kaynak Kod(Source Code) ----- Yorumlanir -----
Ara dil(MSIL)           ----- Derlenir -----
Dogal Kod(Native Code)  ----- Calistirilir -----
.exe
Bir C# programinda bulunan temel yapi ise asagida gosterildigi gibidir.
class Helloworld
      static void Main()
{
System.Console.WriteLine("Hello world");
}
}
Yukaridaki yapiya bakildiginda class anahtar sozcugu ile Helloworld adinda bir sinif yaratilir.C# programlama dilinde,Javadan farkli olarak sinif adlari dosya adlari ile ayni olmak zorunda degildir.Yani dosya adi derleme surecleri arasinda yer almaz.

Main() bir C# programinda ilk calisan metottur.static olmasi bu metodun cagirilirken bir nesneye ihtiyac duymadigi anlamina gelirken,void dondurum tipi ise bu metodun geriye hic bir sey dondurmeyecegi anlamina gelmektedir.Bu program ekrana "Hello world" ibaresi yazmaktadir.Bunu ise Console sinifinin WriteLine() metodu ile yapar.System sinifi ise C#in yerlesik kutuphanelerinden birisidir ve System ad uzayi ile cagirilmaktadir.

Birden fazla System ad uzayinin kullanildigi bir C# programinda using anahtar sozcugunu kullanarak bu ismi yazmaktan kurtulabilirsiniz.
using System;
class Helloworld
      static span style="color:blue;">void Main()
{
Console.WriteLine("Hello world");
}
}
Programlarinizda cogunlukla bu ve buna benzer ad uzaylari(namespace) kullanacaginiz icin yukaridaki 2.versiyon program onerilir.Profesyonel C# programcilari genelde 2.yazilan program stilini kullanir.
There has been no comment yet

Name:


Question/Comment
   Please verify the image




The Topics in Computer Science

Search this site for





 

Software & Algorithms

icon

In mathematics and computer science, an algorithm is a step-by-step procedure for calculations. Algorithms are used for calculation, data processing, and automated reasoning.

Programming Languages

icon

A programming language is a formal constructed language designed to communicate instructions to a machine, particularly a computer. It can be used to create programs to control the behavior of a machine. Java,C, C++,C#

Database

icon

A database is an organized collection of data. The data are typically organized to model aspects of reality in a way that supports processes requiring information.

Hardware

icon

Computer hardware is the collection of physical elements that constitutes a computer system. Computer hardware refers to the physical parts or components of a computer such as the monitor, memory, cpu.

Web Technologies

icon

Web development is a broad term for the work involved in developing a web site for the Internet or an intranet. Html,Css,JavaScript,ASP.Net,PHP are one of the most popular technologies. J2EE,Spring Boot, Servlet, JSP,JSF, ASP

Mobile Technologies

icon

Mobile application development is the process by which application software is developed for low-power handheld devices, such as personal digital assistants, enterprise digital assistants or mobile phones. J2ME

Network

icon

A computer network or data network is a telecommunications network that allows computers to exchange data. In computer networks, networked computing devices pass data to each other along data connections.

Operating Systems

icon

An operating system is software that manages computer hardware and software resources and provides common services for computer programs. The OS is an essential component of the system software in a computer system. Linux,Windows

Computer Science

icon

Computer science is the scientific and practical approach to computation and its applications.A computer scientist specializes in the theory of computation and the design of computational systems.