OOP Series — What is an Object?

What is an Object?

In OO concepts, objects are defined by two components attributes and behaviors(behaviors are referred to as methods). What if I told you, you are an Object? Can you define your attributes and behaviors? For example, what is your name and how old are you? The answers to these questions are your attributes. And how about your behaviors? You can eat, read or if you are ‘chosen one’ you can fly? So we can think of you as an object. In OOP paradigm we are contained attributes and methods in a single object which is an important difference between OOP and other paradigms.

What is a Class?

Classes are used for creating objects. We can say that a class is a blueprint or prototype for an object.

//name of class
public class Agent {
//Public Attributes
//Constructors
//Accessor Methods
//Public Interfaces
//Private Implementations
}
What the hell is this? (Family Guy Noah’s ark scene)
Agent agentSmith = new Agent()
Agent agentJones = new Agent(name="Jones", heightInCM=188)
Agent agentBrown = new Agent(name="Brown", heightInCM=177)
Agent Brown, Agent Smith and Agent Jones from The Matrix

Software Engineer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store