Skip to content
Advertisement

what is meaning of instance in programming?

I don’t get it for long. Are there any alternative words similar to ‘instance’ that are easier to understand? For a non-programmer, how you explain instance? Instance is like example in normal person’s world. I can’t understand what it is if I don’t even understand its meaning.

Advertisement

Answer

“instance” is best understood as it relates to “class” in programming. “Classes” are used to define the properties and behavior of a category of things. E.g. A “Car” class might dictate that all cars be defined by their make, model, year, and mileage.

But you can’t provide specifics about a particular car (for example, that 1978 Chevy Impala with 205,000 miles on it that your uncle Mickey drives) until you create an “instance” of a Car. It’s the instance that captures the detailed information about one particular Car.

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement