What is the difference between an Object and a Class in Java? | Java Tutorial Online

Subscribe to Freshers Jobs

Search 1000’s of local Job Postings ! Increase your chances to get your dream job.

Welcome to FreshersPlane, FreshersPlane Provide you latest Job Notifications , Career Opportunities, Government Jobs Information,

Don't forget to subscribe to email notifications to get all latest jobs directly to your email daily. We post more than 1000+ jobs every week.So,

Welcome back to Java Tutorial Online. This is one of the basic question of Java. In Java everything is an Object, but a Class is used to make it. The exact definition is that “A class is a blueprint for an object”. Particularly it tells the JVM about how to make the Object.

When I say that a class is a blueprint of an Object, I mean that every Object in Java made from that class is practically the same but can have its own specific values. Like whenever a building is made, then a blueprint is made beforehand. The blueprint defines the structure of the building, but using the same blueprint you may create many separate buildings. Each building can have its own color on the walls, its own particular size, etc. But the overall structure will be the same.

I will take one more example to clarify my point. We know that the process of making a car is totally automated. Now the cavity which molds the shape of the car is the same, but the same cavity is used to mold several cars. Like in the Mercedes factory, each Mercedes coming out from the car molding cavity will be practically the same. Though each Mercedes can later be given its particular color, alloy wheels, extra bumper, advanced music system, etc. Here the cavity which molds the car is the “class” in Java, and the Mercedes car coming out from that cavity is the “Object” in Java.



Find the Latest Jobs in our site for freshers , experience .List of walkings , fresher jobs, latest jobs,Govt Jobs, Sarkari Naukri for all engineering branches, all graduates, Apply for all jobs mentioned in our site.

Now you would be easily able to visualize the difference between a class and an Object in Java. I hope that this article was beneficial in helping you distinguish between an Object and a Class. If you liked the article then do leave a comment. I would love to hear from you. For more info on Java, keep buzzing http://freshersplane.net

Comments

comments

Freshersplane is online web Platform working for graduates with aim is to to make the career searching task simpler and easier by providing them information about jobs which are relevant to them. Job Search, Latest Jobs, Government Jobs, Results

Powered by Indian Servers Competitive Exams Syllabus Colleges List TCS Next Step

3 Comments

Add a Comment
  1. u hve explained it so well….the examples u hve quoted made my concepts clear…..

  2. This is the very nice explanation u have given to us…….
    thank u very much…..

  3. very nice ur example for diffrnce b/w object and class..

Leave a Reply

Your email address will not be published. Required fields are marked *

two × five =

Freshers Plane - 2017, 2016 and 2015 Freshers Job updates | Freshersplane Jobs | 2016 Freshers Job Updates | Freshersplane.com © 2017 Frontier Theme