WHAT ARE JAVA CLASSES AND OBJECTS?

Devesh Kumar Singh

Total Post:12

Points:60
Posted by  Devesh Kumar Singh
Java 
 643  View(s)
Ratings:
Rate this:
  1. Devesh Kumar Singh

    Post:12

    Points:60
    What are Java Classes and Objects?

    The term ‘class’ refers to the actual written piece of code which is used to define the behavior of any given class. So, a class is a static piece of code that consists of attributes which don’t change during the execution of a program – like the method definitions within a class. It is like a blueprint for creating different objects which defines its properties and behaviors. . A class can contain fields and methods to describe the behavior of an object.

     

    The term ‘object’, however, refers to an actual instance of a class. Every object must belong to a class. Objects are created and eventually destroyed – so they only live in the program for a limited time. While objects are ‘living’ their properties may also be changed significantly. Objects exhibit the properties and behaviors defined by its class.

      Modified On Mar-28-2018 05:45:46 AM

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!