Difference between Classes, Instance and objects

Difference between Classes, Instance and objects

OOP concepts in classes, interfaces, and Objects

Table of contents

No heading

No headings in the article.

whilst I was learning about classes, objects, and interfaces I was confused between them. so I googled it and found a helpful resource, I would love to share them as you'll too face similar circumstances. "The class = the blue print. The Object is an actual thing that is built based on the ‘blue print’ (like the house). An instance is a virtual copy (but not a real copy) of the object." (mee, 2021).

Object vs Instances The basic concept of Object-Oriented Programming (OOP) revolves around two things, Class, and Object. The class is the blueprint. The Object is an actual thing that is made up using that 'blueprint' (like the car example given above). You cannot see the instances, all you see is code, which is your class. Objects or instances are created at run-time and they are created in a specific memory area called heap memory.

Each instance consumes some memory depending upon how much and what value you store. For example, "Java" is an instance of the String class and holds the memory required to represent those characters and to store some metadata. You might have also heard about class method vs instance methods, right? look we hardly call object method.

There is no harm in calling an instance as an object but if you are following rest of Java convention then why not this one. Do you call the Java method function? No right, then there is no point calling instance as an object, it will just create confusion nothing more.

If you are a senior Java developer or a trainer then it's your responsibility to pass the right terminology to junior developers. Whatever they will hear from you, it will go a long way, so make sure you feed clear and concise information. (paul, 2021).

REFERENCES mee, d., 2021. Understanding Classes vs Objects vs Instances | Codecademy. [online] Codecademy. Available at: https://www.codecademy.com/forum_questions/558cd3fc76b8fe06280002ce [Accessed 22 November 2021].

paul, j., 2021. Difference between instance and Object in Java. [online] Java67.com. Available at: https://www.java67.com/2014/11/difference-between-instance-and-object-in-java.html#ixzz7CxoHzWOa [Accessed 22 November 2021].