170 likes | 288 Views
Object-Oriented Programming. Agenda. Classes Attributes Properties Methods (Functions) Constructor Passing Parameters By Reference & Value Access Modifiers Interfaces Polymorphism Overriding. Classes. <access modifier> class class_name. Class Definition. Note: .
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