ELI5: Explain Like I'm 5

Instantiation principle

Imagine you have a toy car set that comes with a lot of pieces. To make an actual car that you can play with, you need to put together all the pieces in the right order and way. This is kind of like what instantiation principle means in computer programming.

In programming, there are classes that describe how to build something. It's like having instructions for all the pieces you need and how to put them together. But just like with the toy car set, having instructions isn't enough to make the actual car. You need to actually create an instance of the car by putting together all the pieces according to the instructions.

When you create an instance of a class, you are taking the instructions and actually making something that can be used in your program. So, think of the class as the instructions for how to make something and the instance as the actual thing that you can use.

In other words, the instantiation principle states that you need to create an instance (or object) of a class in order to use it in your program. Just like you need to actually put together all the pieces to make the toy car.
Related topics others have asked about: