You are on page 1of 1

Milestone 2

In object-oriented programming concepts, like classes, objects, methods, and functions are
commonly used. These ideas can also be present in programming approaches. Here's a
breakdown of their distinctions;
Class:
When you create a class you're essentially creating a model or blueprint, for making objects. This
model defines the characteristics (such as properties) and behaviours (like functions) that all
instances of the class will have. You can picture a class, as a data format that brings together
information and operations.
Object:
 An object represents an instance of a class. It is an entity formed based on the class
blueprint.
 Objects exhibit state (attributes) and behaviour (methods).
 For instance, in the case of a Car class an object could be a car with features.

Method:
 A method is essentially a function linked to an object that dictates its behaviour.
 These functions are housed within classes. Manipulate the data connected to instances of
the class.
 For example within a Car class there might be a method, like start_engine() that specifies
how the engine should start for each car instance created.

Functions:
 In programming, A function is, like a set of instructions that does a job and can be used
on its own without being linked to anything or a group.
 Functions are not limited to one thing or group.
 Unlike methods, which are connected to things functions stand alone. It can be used
throughout a program.

To sum it up a class is like a blueprint, for making things a thing is an example of a class a
method is an instruction linked to a class or thing and a function is a set of instructions. Object-
oriented programming (OOP) helps in arranging code in a way that encourages flexibility, reuse,
and clear organization by using classes and objects.

You might also like