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

instance

what is instance do...i cant understand plz tell xplain me in detail ,do we have any alterntive to not use that name??

3rd Oct 2020, 1:13 PM
jaswanth nelam
jaswanth nelam - avatar
4 Answers
+ 5
jaswanth nelam Instance is also known as Object. Every entity is an object. Each entity has some properties and behavior. In the same manner, the object has also properties and behaviors. In technical terms, properties are the variables and behavior are the methods. Real-life example: In real life, A Mobile, pen, table, car, house, etc. are entities because they have some properties and behavior. If Mobile is an object it has some properties and behavior.   Properties: color, size, shape, company name. Behavior/Operation: Call, music, camera For more details: https://javagoal.com/class-and-object-in-java/#3
4th Oct 2020, 3:00 AM
Raina Dhankhar
Raina Dhankhar - avatar
+ 2
Instance is used for 2 different things When you create a class the fields/variables are called instance variables. And when you create an object of that class like Ipang example your creating an instance of that class, a reference to the object is stored in the variable which then can be used to refer to the instance variables/methods using the dot.
3rd Oct 2020, 2:36 PM
D_Stark
D_Stark - avatar
+ 1
okay thanks Ipang D_Stark
3rd Oct 2020, 2:46 PM
jaswanth nelam
jaswanth nelam - avatar
0
Instance is a term used to refer to an object created from a certain class. If you hava a class named Dog (for example), then when you create an object from that class Dog snowy = new Dog(); Variable <snowy> is an object, or instance of Dog class. I strongly suggest you to focus on one tutorial at a time. Mixing up learning multiple languages isn't a good idea for getting started.
3rd Oct 2020, 1:58 PM
Ipang