What are members?

Members are individual items that belong to a group or collection, living together inside a container called an object.

Think about your favorite toy box. The box itself is like an object. Inside it sit all your specific toys: the red car, the blue block, and the stuffed bear. Each of those toys is a member because they are part of that group. Without the toys, the box is just empty plastic. Without the box, the toys are just lying on the floor. Being a member means you have a home and you belong to the set.

How Members Work

In computers, we use members to keep things organized so nothing gets lost in the clutter. Imagine a school backpack. The backpack is the object. Its members are the pencil, the apple, and the notebook tucked inside. You can reach into the bag and pull out just the pencil without moving anything else. This is what making a member do: it lets us access one specific thing within a larger group.

ConceptReal Life ExampleComputer Term
ContainerThe BackpackObject
Item InsideThe AppleMember / Attribute
ActionEating the AppleMethod

Sometimes, members are more than just items sitting still. They can also be actions! If your backpack has a zipper that you pull to open it, that zipping action is a method member. It is something the backpack does, while the apple is something the backpack has. Both are essential parts of what makes your backpack work properly every day.

Take the quiz →

Ask a question

See also

Discussion

Recent activity

Categories: History