Object-Oriented Programming; What is that?

The way we naturally think of things is mostly object-oriented.

Ali Shayegh

12/29/20251 min read

students at a college have different name_ s.

They can borrow_books().

Every college welcomes new students every year.

Ali is a student in the Best_College_of_Nowhere!

Now C++!

Ali is an object of type students.

students is the class (or type) that Ali is an instance of.

students is a concept only, it does not occupy physical space, but Ali is a physical object, he occupies space (on RAM!)

college does not exits, it is a concept only. Best_College_of_Nowhere, though, exists (guess where! You cannot, because itโ€™s nowhere!)

college and students are friend classes.

name_ is a member data of students.

borrow_books()is a member function of students.

new creates a new object, and this points to the very object you want to call a member function or a member data of. For example, this->borrow_books(), means a specific student goes borrows books (Gook luck with your exams!)

Want to get a hands on experience of it?

See the Next Trainings.

Closing

Can you write the paragraph at the top in C++ syntax?