Monday, 27 July 2015

Object and Class in java

The Concept of Object and Class in Java

Object in Java

Basically an entity that has state and behavior is known as an object. It has three main characteristics like state,behavior and identity.

Object is an instance of a class.

Object and Class

Class in java

A class is a group of objects that has common properties.

A class can be defined as a template/ blue print that describes the behaviors/states that object of its type support.

Syntax to declare a class

class {  

    data member;  



Sample Program:

class FirstProgram{

   int a;     //data member
   String name;//data member
   public static void main(String args[]){  
      FirstProgram fp=new FirstProgram();  //creating an object of FirstProgram



Note: The Output of the program shows the default values in the variables 'a' and 'name'.


  1. It's interesting that many of the bloggers to helped clarify a few things for me as well as giving.Most of ideas can be nice content.The people to give them a good shake to get your point and across the command.

    software testing course in chennai

    1. Great Article android based projects

      Java Training in Chennai

      Project Center in Chennai

      Java Training in Chennai

      projects for cse

      The Angular Training covers a wide range of topics including Components, Angular Directives, Angular Services, Pipes, security fundamentals, Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training

  2. A great job you have already done. I’m really delighted to see your amazing work.
    tutorial on c++

  3. The online tutorials are one of the best ways to learn our desired courses. Every one of us believes that the computers are an ocean subject to learn. With these tutorials, everyone can become professional towards computers. Reviews in Youtube

  4. I was surfing the Internet for information and came across your blog. I am impressed by the information you have on this blog. It shows how well you understand this subject. situs bokep terbaru