ppt 4

Cards (21)

  • Object-oriented paradigm
    To design the program using classes and objects
  • Object
    • Related to real-world entities such as book, house, pencil, etc.
    • Focuses on writing the reusable code
    • Widespread technique to solve problems by creating objects
  • Major principles of object-oriented programming
    • Class
    • Object
    • Method
    • Inheritance
    • Polymorphism
    • Data Abstraction
    • Encapsulation
  • Class
    • A blueprint from which an object is constructed by the computer
    • Describes the methods (functions) and properties (variables) that will exist in an object when it's created
  • Instantiation
    The process of creating an object of a class in memory
  • Instance

    An object that is built from a class and contains real data
  • Class attributes
    Variables within a class
  • Method
    • A block of code which only runs when it is called
    • Used to perform certain actions
    • Allows code reuse
  • Parameters
    Information passed to methods, acting as variables inside the method
  • Arguments
    Values passed to parameters when a method is called
  • Constructor
    • A special method used to initialize objects
    • Called when an object of a class is created
    • Can be used to set initial values for object attributes
  • Inheritance
    • The ability to inherit attributes and methods from one class to another
    • Subclass (child) - the class that inherits from another class
    • Superclass (parent) - the class being inherited from
  • Inheritance
    • Useful for code reusability: reuse attributes and methods of an existing class when creating a new class
  • Polymorphism
    The ability to perform a single action in different ways
  • Encapsulation
    • Used to restrict access to methods and variables
    • Wraps code and data together within a single unit to prevent accidental modification
  • Object Oriented
    In Java, everything is an Object. Java
    can be easily extended since it is based on the Object
    model.
  • Platform Independent: Unlike many other programming
    languages including C and C++, when Java is compiled,
    it is not compiled into platform specific machine, rather
    into platform independent byte code. This byte code is
    distributed over the web and interpreted by the Virtual
    Machine (JVM) on whichever platform it is being run
    on.
  • Simple: Java is designed to be easy to learn. If you
    understand the basic concept of OOP Java, it would be
    easy to master.
  • Secure: With Java's secure feature it enables to develop
    virus-free, tamper-free systems. Authentication
    techniques are based on public-key encryption.
  • Architecture-neutral: Java compiler generates an
    architecture-neutral object file format, which makes the
    compiled code executable on many processors, with the
    presence of Java runtime system.
  • Portable: Being architecture-neutral and having no
    implementation dependent aspects of the specification
    makes Java portable. Compiler in Java is written in
    ANSI C with a clean portability boundary, which is a
    POSIX subset.