what is class and object explain with example?

Answer Posted / shubham saurabh

Object has states and behaviours. An object is instance of object.Exp:states-colour,name,breed and behaviour-wagging,barking,eating.
A Class is a template/blue print that describes the behaviour of object.

public class Dog
{
string breed;
int age;
string colour;
void barking()
{
}
void hungry(){
}
void sleeping(){
}
}

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can I create my own metadata attributes?

525


What is .net mobile lists. : Microsoft dot net mobile

468


What is cache coherency and how is it eliminated? : .NET Architecture

522


How do we do authentications using atlas?

517


What are the major differences between services and web services?

488






What is textbox control of .net mobile? : Microsoft dot net mobile

609


Explain is development of a mobile web application with asp.net is very easy? : Microsoft dot net mobile

504


Explain element .net mobile with example? : Microsoft dot net mobile

494


What is the .net class that allows the retrieval of a data element using a unique key?

562


What other than biginteger has been introduced in system.numerics namespace?

526


Explain the components required to develop mobile applications with .net mobile? : Microsoft dot net mobile

454


Explain the race around condition? : .NET Architecture

504


When do I need to use gc.keepalive?

636


What is .net mobile automatic paging? : Microsoft dot net mobile

572


Explain about .net garbage collector?

545