VJC Chapter 13 Object Oriented Programming
Uploaded by cheesemuffin · 10 December 2025
Preview
VJC/H2Computing/9569 Chapter 13 Object Oriented Programming (OOP) Contents 1 Components of Object Oriented Programming (OOP) 1.1 Class attributes 1.2 Instance attribute vs Class attribute 2 Encapsulation 3 Inheritance 4 Polymorphism Syllabus Learning Outcomes 2.5 Fundamentals of Object-Oriented Programming Understand concepts of encapsulation, inheritance, and polymorphism. 2.5.1 Define and understand classes and objects. 2.5.2 Understand encapsulation and how classes support information hiding and implementation independence. 2.5.3 Understand inheritance and how it promotes software reuse. 2.5.4 Understand polymorphism and how it enables code generalisation. Exclude: method overloading and multiple inheritance 1
VJC/H2Computing/9569 1 Components of Object-Oriented Programming (OOP) Object-oriented programming (OOP) is a form of programming that groups the data items and the subroutines that operate on the data items in one place so that only these subroutines can access the data items. The data of an object are called attributes (or properties ) and the subroutines acting on the attributes are called methods . The 2 main building blocks of object-oriented programming are classes and objects . A class is a blueprint or a template for an object that contains attributes or properties which describe the data, and methods which can access the attributes. When a class has been defined, it can be used to create one or more objects of this class type. Instantiation is the process of creating a new object. An object is an instance of a class. The objects will have the same attributes and methods as the class from which it was created. A class can be represented using a class diagram. Each class is made up of 3 sections: the class name, properties (attributes) and methods. Class Properties Methods The class diagram below shows an example of a Person class. Person -name -mobile_no constructor() +get_name() +get_mobile_no() +set_name() +set_mobile_no() When we first set up an object of a particular class, we use a constructor. A constructor instantiates the object and assigns initial values to the attributes. A Person class has 2 attributes: name and mobile_no . When we first create a Person object, we use a constructor method __init()__ to instantiate the object and assign values to the attributes. 2
VJC/H2Computing/9569 The constructor method will automatically be called to initialise the newly created object. The
Content continues in the PDF.
Related notes
- VJC Chapter 21 SQLite with PythonNotes/Practices · 2025
- VJC Chapter 23 Web Applications PrinciplesNotes/Practices · 2025
- VJC Chapter 10 RecursionNotes/Practices · 2025
- VJC Chapter 20 SQLNotes/Practices · 2025
- VJC Chapter 16 Hash TableNotes/Practices · 2025
- VJC Chapter 22 NoSQLNotes/Practices · 2025

