Trouble understanding Object State, Behavior, and Identity?

state and behaviour of objects in c++
state of an object in ooad
state and behaviour of an object in c#
identity of an object
what is the behavior of an object
what is object state in c#
maintaining the state of an object is called
what is an object in programming

I have been instructed by my professor to introduce myself on a page as if I were an object, and that I must address three things: 1) Object State, 2) Behavior, and 3) Identity.

However, I am still really confused as to how I would go about doing something like this. (I have read about the three attributes I must address, but I don't know how I would apply it to a person). For example, I was told a dog would have States, such as name, color, and breed; as well as Behaviors, such as walking, barking, or wagging their tail.

So would I do something similar to:

Student me = new Student();
System.out.println(me.getName()); //a state?
System.out.println(me.getCurrentActivity()); //A behavior? (if it were to return watching TV or something) 
System.out.println(me.get....()); //???

Or am I getting the completely wrong idea here?

Java Tutorials: State, behavior, and identity, What happens when you call a method on an object? Answer / benjamin jacob. Identity : Every instance of a class should be unique. e.g. in memory, every object has its own memory address. This is part of the unique id, other than which a user can have

What happens when you call a method on an object in Python , has states - color, name, breed as well as behaviors – wagging the tail, barking, eating. An object is an instance of a class. Class − A class can be defined as a template/blueprint that describes the behavior/state that the object of its type support. state and behaviour are the basic properties of an Object. state tells us about the type or the value of that object where as behaviour tells us about the operations or things that the object can perform.

As a correction to @MrSimpleMind's answer marked as best answer, and elaborating on @JNL's answer: Identity is not what makes the object unique in terms of it's state (e.g. name = "Tim" or whatever). Identity however is that an object is unique in terms of it's location in memory. If you what to read more about this, you can start by looking at this Wiki page: Identity in OOP

UPDATE It's worth mentioning that it's not always in terms of location in memory. When saving an object to a database, it'll essentially be saved as a row, here an ID column is used.

Object identity, Identifying the state and behavior for real-world objects is a great way to begin thinking in terms of object-oriented programming. Take a minute right now to  Object : example on bank a/c State, Behaviour , Identity. For the Love of Physics - Walter Lewin - May 16, 2011 - Duration: 1:01:26. Lectures by Walter Lewin.

State:- state is values of objects variables

Behavior:- are methods of object

Identity:- It is name of object.


class car{

int speed = 100;

void accelerate(){ }


class_car obj_car;


State:- speed

Behavior:- accelerate

Identity:- obj_car

Java - Object and Classes, OOAD Overview Q/A #4 - Question:What is meant by object? How are these All the objects have a state, behavior and identity. State of an object - The state or  Real-life entities share two characteristics : they all have attributes and behavior. An object consists of: State: It is represented by attributes of an object. It also shows properties of an object. Behavior: It is represented by methods of an object. It shows response of an object with other objects. Identity: It gives a unique name to an

In the programming implementation of an object,

its state is defined by its instance variables. Instance variables are private to the object. Unless explicitly made public or made available to other "friendly" classes, an object’s instance variables are inaccessible from outside the object.

An object’s behavior is defined by its methods. Methods manipulate the instance variables to create new state; an object’s methods can also create new objects. Java white paper page:34

What Is an Object? (The Java™ Tutorials > Learning the Java , Page 02-3 Object-Oriented Programming (OOP) Objects and Classes 3 • An object is a tangible, intangible, or software entity. • It is characterized by Identity,  You can take a look to (and cite) the book "Object-Oriented Analysis and Design" by G. Booch : An object is an entity that has state, behavior, and identity. The structure and behavior of similar objects are defined in their common class. The terms instance and object are interchangeable.

OOAD Overview Q/A #4, An object is an entity that has state, behavior, and identity. keep in mind that the state of an object is an "abstract" entity, as determined by what is Part of the difficulty in defining the state of an object in OOP is that when we  In this paper, we present a discussion of methods that define object behavior and character (class)-level state variables that track state changes for 3D animated objects in small virtual worlds.

State Behavior and Identity of an Object \u00be What is a Class , 2 What is an Object? “An object has state, behavior, and identity; the structure and behavior of similar objects are defined in their common class.” Some things  State: Represents data (value) of an object. Behavior: Represents the behavior (functionality) of an object such as deposit, withdraw etc. Identity: Object identity is typically implemented via a unique ID. The value of the ID is not visible to the external user. But,it is used internally by the JVM to identify each object uniquely.

Definition of the state of an object in OOP, In Object Oriented Programming we are trying to model either real world that we are trying to solve and the entities in the scope of the problem. Abstraction is dependent on perspective - what is important in one context may not be in another. Identity - a name; State - determined by the values of its attributes; Behavior  Objects are key to understanding object-oriented technology. Look around right now and you'll find many examples of real-world objects: your dog, your desk, your television set, your bicycle. Real-world objects share two characteristics: They all have state and behavior. Dogs have state (name, color, breed, hungry) and behavior (barking

  • Thanks for the help, but I also need to know what they would consider a state, behavior, and identity. Those are the main things I didn't understand/was seeking help for.
  • With the explanation for Identity, I think the identity is more with the unique object. Student id and email id would be the properties for the student.
  • properties that are unique in matter, and make this specific object unique in the domain. This is not the same as the hashcode of an object.
  • This answered my question perfectly, thank you for helping me!
  • sounds like you are talking from c# ? as java does not have "top" static classes, but you can do static nested classes, or using final classes, make all methods static etc... but anyway.. you should think of a static like your states are all the same, for all callers, there is only one copy... you don't need an instance of the class to use the "states". They are static, one copy, right.
  • I see. So Behavior would be as I explained, watching TV or talking to people. What about Identity though?