What is an int? An int is a data type that represents a whole number. Whole numbers can be positive or negative, but they cannot have a decimal point. They are often used to represent things like counts (1, 2, 3) or dates (January 1, 2000).
So what’s the difference between an open int and a closed int? A closed int is simply an int that has been given a value. An open int, on the other hand, has not been given a value. This may seem like a small distinction, but it’s actually quite important.
Why? Well, let’s say you’re writing a program that needs to keep track of how many times a user clicks a button. You could use a closed int for this, and just set it to 0 when the program starts. But what if the user clicks the button 100 times? The number would quickly become too large to fit into an int.
This is where open ints come in handy. An open int can hold any whole number, no matter how large. So if you’re keeping track of something that could potentially get very large, you should use an open int.