CS-1 Lecture Notes - Lecture 1: Bjarne Stroustrup, Object-Oriented Programming, Multiple Inheritance

12 views24 pages
18 Jul 2022
Department
Course
Professor

Document Summary

Object-oriented programming or oops refers to languages that use objects in programming. Object-oriented programming aims to implement real-world entities like inheritance, hiding, polymorphism, etc in programming. The main aim of oop is to bind together the data and the functions that operate on them so that no other part of the code can access this data except that function. When we consider a c++ program, it can be defined as a collection of objects that communicate via invoking each other"s methods. Let us now briefly look into what a class, object, methods, and instant variables mean: object objects have states and behaviors. Example: a dog has states - color, name, breed as well as behaviors - wagging, barking, eating. An object is an instance of a class: class a class can be defined as a template/blueprint that describes the behaviors/states that object of its type support, methods a method is basically a behavior.