FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Object_Oriented_Programming/Object_Oriented_Programming at master · SongulSYTRK/Object_Oriented_Programming · GitHub

Latest commit

 

History

History

README.md

What is Class ?


It is the whole brought together by members who have common characteristics. <br< It is a system that stores variables and methods together.
Our class need Access Modifiers. If you dont have access modifiers, you dont see properties of class .
Access Modifiers(Erişim belirteçleri)
1. Public: You see all solution

2. private :you see this class
3.internel: If you dont define access modifiers , your objects modifiers internal .you see this project

public class Computer 
{

public string cpu; 
public string displaycard;
public int memoryCapacity;
public string displayScreen;

}

What is Constructor ?

It determines the Instance taking rules according to which conditions in the class we created. Each class have constructor . you dont write any constructor, it has empty constructor in background The constructor method is used to initialize our class.The constructor method will be triggered when the class is instantiated, making the class ready for use and initializing it. Constructor's name has to be same with class name

You can define more overload

 public class Car    //Class
   {
       //property shortcut prop+tab+tab
       public string Brand { get; set; }
       public string EngineSize { get; set; }
       public string Model { get; set; }
       // constructor shortcut ctor+tab+tab
       
  public Car(string marka ) // constructor 
{
           this.Brand = marka;
           
 }      


Back | FazBrowse Home | New Git URL