What is instance | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What is instance

28th Sep 2018, 9:01 PM
rakesh kumar
rakesh kumar - avatar
3 Answers
+ 13
Instance is simply object of a class, e.g.: class Shape{} Shape circle = new Shape; // instance of class Shape Shape square = new Shape; // another instance of class Shape
28th Sep 2018, 9:53 PM
Aleksander Szczepura
Aleksander Szczepura - avatar
+ 4
its an object of class, The chances are you have created a object from the Scanner class using the new keyword its the same as saying you have created an instance of class Scanner
28th Sep 2018, 9:52 PM
D_Stark
D_Stark - avatar
0
The instance is one object of class. For example the definition of dog is the class Dog which describes all dogs. Instead Spot is my dog. So, Spot is an instance of dog's class.
29th Sep 2018, 6:45 PM
Ciprian Popa