C# PROGRAMMING LANGUAGE EXAMPLES

c# programming

C# is a language developed by Microsoft. It is very similar to C++ and Java. However, unlike C++, C# is 100% object oriented. Unlike Java, the pointer can be used in C#.

Object and object-oriented programming
(Object-Oriented Programming-OOP)

C# What is class?

There are only objects in the programs we write OOP type. These objects communicate with each other by Exchanging Messages.
Objects are also created from templates that are expressed as classes in the OOP. In each class, the properties and behaviors of the objects to be produced from that class are determined. For example, we could create a class called cars. The objects that will be produced from this class will be parts such as a motor, 4 wheels, steering, etc.

C# What Is Object?

The object is a software component that contains the data and methods(functions) that will be processed on that data. In accordance with this definition, the object carries its own functionality as well. Objects can be used repeatedly in every application. The data and methods together take the name of the members of the object. An object structure is defined in a class. The member variables and methods that make up the object in the class are explicitly defined.

C# What is the method

Methods are the doors of an object to the outside world. What is inside an object is not visible from the outside, how the object works. The object has an inner world. If we want to enter an interaction with the object, we need to use one of the methods that opens out. A class is a collection of objects that are defined in a class. If we expect an object to do something, we send a message to it using its method. The object receives this message and performs the required operation.
Methods define the behavior of objects against the outside world. We can consider methods as functions used in other programming languages. With objects, we can enter interaction using only these methods.

C# Events

Events are continuously used in Object-Oriented Programming environments. The most common example here is event called click for an object belonging to the button class. In the Click event, an event is thrown when the mouse and button object are clicked on.

C# Programming Language Examples

Example;

class ilkYazilim
{
static void Main()
{
System.Console.WriteLine("Merhaba");
}
}
Example;
using System;
class ilkprogram
{
static void Main()
{
Console.WriteLine("Merhaba");
}
}
Example;
using System;
class ilkprogram
{
static void Main()
{
Console.WriteLine("Entera bas!");
Console.ReadLine();
Console.WriteLine("Entera bastın!");
}
}

Leave A Reply

Your email address will not be published.