</>Learn to Write Code
LearnPseudocodeReal CodeLanguagesVideosCode TalkAbout
Learn → Programming Fundamentals → Objects & Blueprints

Programming Fundamentals

01Variables02Operators03Input & Output04Sequence05Conditions06Loops07Functions08Objects
Lesson 8 of 8·Beginner

Objects & Blueprints

Describe a kind of thing once, then create individual objects that carry their own data and behavior.

Related:classobjectblueprintinstanceproperty

A class is a blueprint; an object is one thing built from it

A blueprint describes what a kind of object should know and what it should be able to do.

An object is one actual instance made from that blueprint. Two Player objects can follow the same blueprint but have different names and scores.

Blueprint: the recipe. Object: one dish made from that recipe.
Try it: If Car were a blueprint, name two pieces of data that each Car object might store.

Describe the Player blueprint

The blueprint defines the data. Then we create one Player object and give it values.

Pseudocode
BLUEPRINT Player
    CREATE name AS ""
    CREATE score AS 0
END BLUEPRINT

CREATE Player AS playerOne
CHANGE playerOne.name TO "Brian"
CHANGE playerOne.score TO 10

SHOW playerOne.name
SHOW playerOne.score

The same idea in Python

Python classes commonly initialize each object inside __init__.

Python
class Player:
    def __init__(self):
        self.name = ""
        self.score = 0

playerOne = Player()
playerOne.name = "Brian"
playerOne.score = 10

print(playerOne.name)
print(playerOne.score)

The same idea in JavaScript

JavaScript uses class and constructor for this style of object.

JavaScript
class Player {
    constructor() {
        this.name = "";
        this.score = 0;
    }
}

const playerOne = new Player();
playerOne.name = "Brian";
playerOne.score = 10;

console.log(playerOne.name);
console.log(playerOne.score);

The same idea in C#

C# properties define the data each Player object can hold.

C#
class Player
{
    public string Name { get; set; } = "";
    public int Score { get; set; } = 0;
}

Player playerOne = new Player();
playerOne.Name = "Brian";
playerOne.Score = 10;

Console.WriteLine(playerOne.Name);
Console.WriteLine(playerOne.Score);

The same idea in Java

Java fields can store the same name and score values on each Player object.

Java
class Player {
    String name = "";
    int score = 0;
}

Player playerOne = new Player();
playerOne.name = "Brian";
playerOne.score = 10;

System.out.println(playerOne.name);
System.out.println(playerOne.score);

The same idea in C++

C++ classes can expose data members that belong to each object.

C++
class Player
{
public:
    std::string name = "";
    int score = 0;
};

Player playerOne;
playerOne.name = "Brian";
playerOne.score = 10;

std::cout << playerOne.name << '\n';
std::cout << playerOne.score << '\n';
Lesson 8 of 8 · Concept
← Previous Lesson: FunctionsEnd of fundamentals

Learn to Write Code

Learn the idea first, write it in pseudocode, then see how real programming languages express the same logic.

Learn

CurriculumPseudocode StandardLanguagesReal Code

Elsewhere

Code TalkAbout BriancodeBetter on YouTubeSupporting files on GitHubAdvertising & Promotions
© 2026 Learn to Write Code. Educational content and examples are provided for learning purposes.