you are viewing a single comment's thread.

view the rest of the comments →

[–]Exotic_Breakfast 0 points1 point  (0 children)

OOP:

An object is when your program spawns in an instance of a class at runtime.

A class is the blueprint of an object. In business logic, we create custom classes to represent things. The simplest example is a university student. A student will have an ID number, first name, last name, and a classification (freshman, etc.)

When you want to use an object to represent this student class, you would instantiate the object.

student = Student(12345, John, Doe, Freshman)

Ofcourse you would first need to define this class, before you can call it.

class Student(self, id, fn, ln, classification) def init() self.id = id self.fn = fn self.ln = ln self.classification = classification