We can Give You Tutorial of C#, Visual Studio, Html, CSS, Javascript Etc. Programming languages in Programming Kida Blog by Ganesh Chorghe & Salman Attar.

Latest Post by Programmingkida.Com

Post Top Ad

Your Ad Spot

Tuesday, 3 September 2019

What is object oriented Programming Language & There Features ?

What is object oriented Programming Language ?

object oriented programming

  • C#.net is a object oriented programming language. means this language is fully depended on Class & Object based, without Class & Object you can't called this object oriented programming language.
  • In C# programming in which the data logically represented in the form of a Class and Physically represented form of Object it called as object oriented programming language.
  • In oops concept are used classes and object , there are classes member & method access from object ,and create the parent-child relationship in between two or more classes.



Features of object oriented Programming Language

  1. Class
  2. Data Encapsulation
  3. Data Abstraction OR Data Hiding 
  4. Object & Instance
  5. Inheritance 
  6. Polymorphism 


  • Class : A class is a logically representation. A Class is a way to find it's data member & member function together. class is a blueprint of the object. 
  • Data Encapsulation : The process of wrapping of data and code into a single unit means single Class is called as Data Encapsulation. 
            Class = Data members + Member Functions
  • Data Abstraction OR Data Hiding : The process of hiding the details from the class for the rest of the program is called as hiding. The main advantage of data hiding is giving the security to member of class. Data hiding is possible by using access modifier PRIVATE ( keyword).
  • Object & Instance : When we create the object by using the keyword new , then the memory will be allocated in heap memory area and it's static memory address store in a stack memory area it is call as an Instance.
                                                     When object is created with using keyword new then memory will be directly allocated in stack memory area and the object in the start contains value NULL

Ex :  Employee E1;                                    // Object
         Employee E1 = new Employee;       // Instance

  • Inheritance : The process of creating new class from an existing class it's called as Inheritance. 
  The main advantages of Inheritance are following
  • Re-usability of the code.
  • Maintain very easy.
  • Flexibility. 
  • Polymorphism : Polymorphism means having more than one form's.




What is Access modifier OR Access specifiers ?


Access modifier are the keyword of the language that provide the access level's for the member's of a class.

Following is the list of Access Specifier

  1. public
  2. Internal
  3. protected
  4. protected Internal
  5. private



  • PublicThe member declare as a public are access from outside the class by using an object of class.
  • Internal : The member declare as a internal are only can access inside the class , not a outside
  • Protected : The member declare as a protected are access within the class OR inherited class.
  • Protected Internal : the member declare as a protected Internal are access within project OR program code and outside the program only within Inherited class outside is not possible.
  • Private : The member declare as a private they are access only within the class. The private member of a class are restricted to that class and directly we cannot access outside.





How to create a class ?


  • A class can be created with the two access modifier public & Internal By default the class is public , members of class are private. general form to create a class.
* Syntax 

[Access Modifier] class ClassName

{
-----------------------             // method
-----------------------
}


  • Class is a keyword used to work with the classes. A class contain variable for storing the data and method to perform various operation's on data.





How to create a Object OR Instance ?

Class does't allocated any memory. When we create Object OR Instance of the class then it allocated the memory for the class

* Syntax

< ClassName > obj = new < ClassName > () ;





Accessing the members of the class

To access the member of a class. we need an operator called . ( DOT ) operator . It's also called as member access operator.

General Syntax

< obj > . < member > ;

No comments:

Post a Comment

Pages