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??
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
+ 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.
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.