OOP java


Published on

1 Like
  • Be the first to comment

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

OOP java

  1. 1. Java Object Oriented M Iqbal Al GhazalyThis beginner Java tutorial describes fundamentals of programming in the Java programming language.
  2. 2. OOPObject Oriented Programming (OOP) is a programming method that based from object. Small think from OOP is an object collection that interact with each other and excange an informationInheritancePolymorphismAbstractionEncapsulation
  3. 3. InheritanceA class that is derived from another class iscalled a subclass . The class from which the subclass is derived is called a superclass .
  4. 4. Inheritance illustration
  5. 5. Polymorphism The word "polymorphism" means "many forms". It comes from Greek word "poly"(means many) and "morphos" (means form).
  6. 6. Polymorphism illustration
  7. 7. AbstractionAbstraction is a very important element of object orientedsoftware development and is used in the design phase tofind a suitable hierarchy for a set of classes.Abstraction refers to the ability to make a class abstract inOOP. An abstract class is one that cannot be instantiated.All other functionality of the class still exists, and itsfields, methods, and constructors are all accessed in thesame manner. You just cannot create an instance of theabstract class.
  8. 8. EncapsulationEncapsulation is one of the four fundamental OOP concepts. The other three are inheritance, polymorphism, and abstraction.Synonym: information hidingEncapsulation is one of the most important characteristics of an object oriented system.
  9. 9. Repetition Control StructuresDecision control structures are Java statements that allows us to select and execute specific blocks of code while skipping other sections. If statement Switch statement Repetition Control Structures
  10. 10. If statementThe if-statement specifies that a statement (or block of code) will be executed if and only if a certain boolean statement is true.Devided by 3,they are:If-elseIf-else-ifIf-else-else-if
  11. 11. Switch statementAnother way to indicate a branch is through the switch keyword. The switch construct allows branching on multiple outcomes.
  12. 12. switch( switch_expression ){case case_selector1:statement1;statement2;break;case case_selector2:statement1;statement2;break; default: statement1;statement2;break;}
  13. 13. Repetition Control StructuresRepetition control structures are Java statements that allows us to execute specific blocks of code a number of times. There are three types of repetition control structures, the while, do-while and for loops.
  14. 14. While loop The while loop is a statement or block of statements that is repeated as long as some condition is satisfied.while( boolean_expression ){statement1;statement2;...}
  15. 15. do- whileThe do-while loop is similar to the while-loop. The statements inside a do-while loop are executed several times as long as the condition is satisfied.do{statement1;statement2;...}while( boolean_expression );
  16. 16. For-loopThe for loop, like the previous loops, allows execution of the same code a number of times.for (InitializationExpression; LoopCondition; StepExpression){statement1;statement2;...}
  17. 17. Arithmetic in javaArithmetic has a job such as mathematics, it uses for doing mathematics operation, such as pluses, division, minuses, and times