what is class and object explain with example?
Answers were Sorted based on User's Feedback
Answer / karthik
Classes and objects are separate but related concepts.
Every object belongs to a class and every class contains
one or more related objects. A Class is static. The
attributes of a class don't change. An Object on the other
hand has a limited lifespan. Objects are created and
eventually destroyed. Also during that lifetime, the
attributes of the object may undergo significant change. A
class is a general concept while objects are the specific
and real instances that embody that concept
Is This Answer Correct ? | 46 Yes | 10 No |
Answer / dsr
class is templet of an object. object is a instatiate the
class.Object is super class of all objects.
Class One{ //class
public void getMethod(){
Console.WriteLine("one....");
}
public static void main(String[] args)
{
One one = new One(); //one is an object of that class.
console.writeLine();
}
Is This Answer Correct ? | 15 Yes | 3 No |
Answer / prachi bidwale
CLASS IS A COLLECTION OF VARIABLES AND FUNCTIONS.
Is This Answer Correct ? | 9 Yes | 3 No |
Answer / 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 |
Answer / kvr
class had not any methods and variables class pointed to
where we get methods and variable
object have methods and variables
Is This Answer Correct ? | 9 Yes | 7 No |
Answer / manas kumar maharana
object is a realworld entity which have some proporty and
behabiour.it is a runtime entity in oops.it is a
partitioned area of memory containg data and function to
process the data.
class is a collection of simillar type of objects.it is a
user define datatype
example:
class muna
{
memberfunction()
{
datatype:
}
};
main()
{
muna ob1;
ob1.memberfunction();
}
Is This Answer Correct ? | 6 Yes | 4 No |
Answer / achal pagar
Class is base of OOPS and the user define data type;class is hert of any program.
Is This Answer Correct ? | 2 Yes | 0 No |
how to make and display a form without title bar?
Which Binding best suits where a WCF Service and the client application resides in the same machine?
How do I know when my thread pool work item has completed?
6. Wcf- what is SOA
how do u achieve multilevel inheritance in .NET ?
9 Answers Accenture, Ness Technologies, SteelWedge,
Please tell me the .net 2.5 frame work with example
what is a namespace?how they are classified?write a program which contains class,object,inheritance?
Explain 'managed' mean in the .NET context
what does dot in .net means
How can i create only one instance of class and thus doesn't allow creating any more instances?
Different types of authentication modes in .net framework ?
What is a clickonce application?