What is object ?

This item was filled under [ Interview Questions ]

Object is nothing but memory allocation for to store values and do some functions.The main usage of object is reusable.Objects are expose the behaviour of class.by creating objects we can use the fucntionality of class for various different type of actions.

example:

class one

{

int a,b,c;

public one()

{

a=0;

b=0;

c=0;

}

public int add(int a,int b)

{

c=a+b;

return c;

}

}

//here is the entry point.

static class entry_point

{

static void main()

{

one a=one();

console.write(a.add(2,3).toString());

//this is reusable

one b=one();

console.write(a.add(6,7).toString());

}

}

Share and Enjoy:
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google
Tagged with: [ , ]
You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Leave a Comment

You must be logged in to post a comment.