170 likes | 297 Vues
This agenda covers the essential concepts of Object-Oriented Programming (OOP). It includes a detailed overview of classes, their attributes, properties, and methods. Learn about constructors, parameter passing by reference and value, and the importance of access modifiers such as public, private, protected, and internal. We will also delve into interfaces and the concept of polymorphism, including static and dynamic polymorphism through function and operator overloading. Master these fundamental principles to enhance your programming skills.
E N D
Agenda • Classes • Attributes • Properties • Methods (Functions) • Constructor • Passing Parameters By Reference & Value • Access Modifiers • Interfaces • Polymorphism • Overriding
<access modifier> class class_name Class Definition Note: • Access modifier specify the access rules for the members as well as the class itself, if not mentioned then the default access for the members is private. • To access the class members, you will use the dot (.) operator. • The dot operator links the name of an object with the name of a member.
Class Features: • Attributes<access modifier> <data type> variable1; <access modifier> <data type> variable2; • Properties<access modifier> <data type> prop_name { get{ } set{ } } • Methods<access modifier> <return type> method name(Parameter) { Method Body } • Constructor<access modifier> class name(Parameter)
List of Access Modifiers: • Public • Private • Protected • Internal • Protected internal
An interface is defined as a syntactical contract that all the classes inheriting the interface should follow. • The interface defines the 'what' part of the syntactical contract and the deriving classes define the 'how' part of the syntactical contract.
Static Polymorphism: • Function overloading • Operator overloading • Dynamic Polymorphism
Summary: • Classes • Classes Features • Access Modifiers • Interfaces • Polymorphism
Contact Me engmohamed.emam@yahoo.com @lilemam 01023513868 /lil.emam