Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

what is the meaning of instance and instance variables

 
Vishal Hegde
Ranch Hand
Posts: 1077
Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what does instance mean in corejava
 
Muhammad Khojaye
Ranch Hand
Posts: 449
IntelliJ IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vishal Hegde wrote:what does instance mean in corejava

As per Wikipedia,
In object-oriented programming with classes, an instance variable is a variable defined in a class (i.e. a member variable), for which each object in the class has a separate copy.
An instance variable is the opposite of class variable, and it is a special type of instance member.

Similarly, non-static field in your program would be your instance variable because their values would be unique to each instance of a class .

Also, I think "instance" keyword is same as "instance variables" in the context of Java
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic