logotransparent.png

Legion of Learners

www.lol-101.com

  • Home

  • Classrooms

  • Courses

  • About Us

    • Executive Team
    • Board Members
  • Resources

  • More

    Use tab to navigate through the menu items.
    To see this working, head to your live site.
    • Categories
    • All Posts
    • My Posts
    sfolax6776
    Jun 30, 2018
      ·  Edited: Aug 12, 2021

    1-2 What is Object-Oriented Programming?

    in AP Computer Science A

    A. Notes:

    1. OOP is in contrast with procedural programming, where programmers select primitive data types, then focus on the step by step procedure to solve a problem

    2. OOP relies on the concept of classes and objects, where programmers analyze the nature and relationships among different classes and objects. The focus is on modeling a subset of the world such as a school, a bank, a company or a store

    3. Real-world objects have states and behaviors, in software these are turned into variable values and methods. So OOP is a matter of designing variables and methods.

    4. Four principles of OOP

    • Encapsulation: lock information in an object, only exposing services or actions as necessary

    • Inheritance: child classes inherit data and behaviors from parent class to promote code reuse

    • Polymorphism: many varieties of a certain behavior to allow flexibility

    • Abstraction: only exposing high level public methods for accessing an object, just as how people drive different cars using the same set of tools of a steering wheel, the dashboard, a brake and a gas pedal.

    B. Exercises:

    1. Real-world objects contain ___ and ___.

    2. A software object's state is stored in ___.

    3. A software object's behavior is exposed through ___.

    4. Hiding internal data from the outside world, and accessing it only through publicly exposed methods is known as data ___.

    5. A blueprint for a software object is called a ___.

    6. Common behavior can be defined in a ___ class and inherited into a ___ class.


    0 comments
    0
    0 comments

    Questions? Email us at legionoflearners@gmail.com or join our WeChat group!

    • lol-101dotcom

    ©2020 Legion of Learners