---
title: "Define object; method implements behavior"
subject: "Object Oriented Analysis and Design"
chapter: 1
key: "semester_6/object_oriented_analysis_and_design:define-object-method-behavior"
source: https://www.bctengineer.com/q/semester_6/object_oriented_analysis_and_design/define-object-method-behavior
site: BCT Engineering
---

# Define object; method implements behavior

Object Oriented Analysis and Design · Chapter 1: Object Oriented Fundamentals

- Asked in: 2071 Magh, 2+3 marks
- Video: [Fundamental Concepts of Object Oriented Programming](https://www.youtube.com/watch?v=m_MQYyJpIjg) — Computer Science Lessons
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_6/object_oriented_analysis_and_design/define-object-method-behavior
- Whole chapter: https://www.bctengineer.com/md/semester_6/object_oriented_analysis_and_design/chapter-1

## Question

Define Object with example. A method implements the behavior of object. Justify.

## Short answer

An object is an entity with identity, state (attributes), and behavior (operations). Behavior defines what an object can do; a method is the actual code implementing that operation, changing state or returning values. Without a method, an operation remains a declaration; a method thus justifies behavior by providing the concrete implementation.

## Answer

#### Object
An **object** is an entity of the problem domain that has **identity, state and behaviour**. It is an instance of a class. A student, a bank account, a book or a car are objects.

**Example:** Object `acc1` of class `Account`
- Identity: `acc1` (distinct from `acc2`)
- State (attributes): `accNo = 1001`, `balance = 5000`
- Behaviour (operations): `deposit()`, `withdraw()`, `getBalance()`

```text
 +-----------------------+
 | acc1 : Account        |
 |-----------------------|
 | accNo = 1001          |   state
 | balance = 5000        |
 |-----------------------|
 | deposit(), withdraw() |   behaviour
 +-----------------------+
```

#### A method implements the behaviour of an object
**Behaviour** is how an object acts and reacts, in terms of state change and message passing. It is the *what* an object can do, decided in analysis as an **operation** (e.g. "an account can be withdrawn from"). A **method** is the actual code that carries out that operation inside the class.

Justification:
1. Every behaviour (operation) of an object needs a concrete body that changes the state or returns a value; that body is the method.
2. When another object sends a message `acc1.withdraw(500)`, it is the method `withdraw` that runs, checks `balance >= 500` and reduces `balance`. This is the observable behaviour.
3. Without the method, an operation is only a declaration with no effect.
4. Different classes may implement the same operation by different methods (polymorphism), which gives different behaviour for the same message.

So behaviour is the abstract responsibility and the method is its implementation.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. Which three things characterise an object?
   A. Name, type, size
   B. Identity, state and behaviour
   C. Class, interface, package
   D. Input, process, output
   Answer: B. An object is an instance of a class with identity, state (attributes) and behaviour (operations). (Key point: Definition of object)

2. What is the difference between an operation and a method?
   A. The operation is the abstract responsibility; the method is the code that implements it
   B. They are the same
   C. A method is declared in analysis; operation is the code
   D. A method is an attribute
   Answer: A. Behaviour is the abstract responsibility, and the method is its implementation. (Key point: Operation vs method)

3. When acc1.withdraw(500) is sent, what actually runs?
   A. Only the declaration of withdraw
   B. The method withdraw, which checks balance >= 500 and reduces balance
   C. The class Account itself
   D. Nothing, until deposit() is called
   Answer: B. The method body produces the observable behaviour; without it an operation has no effect. (Key point: Why method implements behaviour)

4. What can different classes do with the same operation?
   A. Nothing, it must have one method
   B. Implement it by different methods, giving different behaviour for the same message
   C. Share the same attributes automatically
   D. Hide it from the object
   Answer: B. That is polymorphism: same operation, different methods. (Key point: Polymorphism of methods)

## Related in Object Oriented Analysis and Design

- [Behavior modeling and four diagrams](https://www.bctengineer.com/question.md?key=semester_6%2Fobject_oriented_analysis_and_design%3Abehavior-modeling-four-diagrams) — Object Oriented Analysis and Design, chapter 2
- [Requirement elicitation and system behavior](https://www.bctengineer.com/question.md?key=semester_6%2Fobject_oriented_analysis_and_design%3Arequirement-elicitation-in-ooa) — Object Oriented Analysis and Design, chapter 2
- [Representing dynamic behavior in OOA](https://www.bctengineer.com/question.md?key=semester_6%2Fobject_oriented_analysis_and_design%3Adynamic-behavior-representation-ooa) — Object Oriented Analysis and Design, chapter 2
