To understand what an instance is, we must first understand what a class is.
A class is simply a modeling tool provided by a programming language for use in representing real-world objects in a program or application.
The class is structured to accommodate the properties of an object (member variables) and its operations (functions / member methods).
An instance on the other hand is just a variant of an object created from a class. You create an instance of an object ( Instance ) using a constructor, which is a method in a class specifically defined for this purpose.
Consider a car, if you want to present it in your application, you must define a class, designated as a car, which contains the properties of the car and the operations that the car can perform.
This would look somewhat close to this, assuming it was done in the Java programming language:
public class Car{
Create a car instance: -
Car BMW = new Car("385 i", 2010);
BMW is a copy of the car.
Aukins moruri
source share