Presentation is loading. Please wait.

Presentation is loading. Please wait.

Like our natural language. Designed to facilitate the expression and communication ideas between people and computer Like our natural language. Designed.

Similar presentations


Presentation on theme: "Like our natural language. Designed to facilitate the expression and communication ideas between people and computer Like our natural language. Designed."— Presentation transcript:

1

2 Like our natural language. Designed to facilitate the expression and communication ideas between people and computer Like our natural language. Designed to facilitate the expression and communication ideas between people and computer

3 Object Oriented (OO)Programming (eg- Java,C++,Smalltalk and Eiffel) Functional Programming(eg-Lisp,Scheme,Haskell and ML) Logic (Declarative) Programming(eg-Prolog) Event Driven Programming(eg-Visual Basic and Java) Imperative Programming(eg-Cobol,Fortran,C and C++) Concurrent Programming(eg-SR) Object Oriented (OO)Programming (eg- Java,C++,Smalltalk and Eiffel) Functional Programming(eg-Lisp,Scheme,Haskell and ML) Logic (Declarative) Programming(eg-Prolog) Event Driven Programming(eg-Visual Basic and Java) Imperative Programming(eg-Cobol,Fortran,C and C++) Concurrent Programming(eg-SR)

4

5 Encapsulation Inheritance Polymorphism

6 If you want maintainability, flexibility, and extensibility!

7 If you want maintainability, flexibility, and extensibility, your design must include encapsulation. How do you do that?

8 public class Room{ public int size; public int name;... } public class OfficeRoom{ public static void main (String [] args) { Room b = new Room(); b.size =6; // Legal but bad!! }

9

10 Keep instance variables protected (with an access modifier, often private). Make public accessor methods, and force calling code to use those methods rather than directly accessing the instance variable.

11 Parent or Super Class Child or Sub Class

12 In object-oriented programming, polymorphism (from multiple forms") is the characteristic of being able to as particular symbol or "operator" in different contexts.

13 Public keyword Unrestricted.accessed from the code fragments of any class. Private keyword Only allowed within the code fragments of a class. Protected keyword Only allowed within the code fragments of a class and its sub class.

14 Static Method Abstract Method Final Method

15 Static method is assigned to a class and not to an object of that class. final class Math{ const PI = M_PI; static public function abs($num){ return abs($num); } echo Math::PI; echo ' '; echo Math::abs(-4.15); echo ' '; echo Math::sqrt(9); Static method is assigned to a class and not to an object of that class. final class Math{ const PI = M_PI; static public function abs($num){ return abs($num); } echo Math::PI; echo ' '; echo Math::abs(-4.15); echo ' '; echo Math::sqrt(9);

16 Declared as final can’t be overridden in a sub-class.

17 designed by the abstract keyword and no body. Used in abstract classes to impose a certain functionality on sub-classes of the abstract class.


Download ppt "Like our natural language. Designed to facilitate the expression and communication ideas between people and computer Like our natural language. Designed."

Similar presentations


Ads by Google