1 / 17

Object-Oriented Programming

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: .

skule
Download Presentation

Object-Oriented Programming

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Object-Oriented Programming

  2. Agenda • Classes • Attributes • Properties • Methods (Functions) • Constructor • Passing Parameters By Reference & Value • Access Modifiers • Interfaces • Polymorphism • Overriding

  3. Classes

  4. <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.

  5. 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)

  6. Passing Parameters By Reference & Value

  7. Access Modifiers

  8. List of Access Modifiers: • Public • Private • Protected • Internal • Protected internal

  9. Interfaces

  10. 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.

  11. Polymorphism

  12. Static Polymorphism: • Function overloading • Operator overloading • Dynamic Polymorphism

  13. Overriding

  14. Summary: • Classes • Classes Features • Access Modifiers • Interfaces • Polymorphism

  15. Contact Me engmohamed.emam@yahoo.com @lilemam 01023513868 /lil.emam

More Related