what are the differences b/w structure and class?

Answer Posted / sai laxman

class ex:-
class classname
{
int a;
float b;
}
struct {
int a;
int b;
}struct name;

In the struct all members are by default public,
in the class we can deference it private,public,protected.
While Inheriting from the structure all the members are
public by default but in class it depends upon the data
access modifiers.

Is This Answer Correct ?    7 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

in object oriented programming, how would you describe encapsulation?

819


How many kinds of elements an array can have?

684


What is difference between an Structure and Class?

823


Why do we use readonly in c#?

703


What is class and object c#?

694


Define mutex in C#?

838


What is the use of console readkey in c#?

708


What is single dimensional array in c#?

734


what is a structure in c#

1085


Why delegate is used in c#?

695


What is the difference between proc. Sent by val and by sub?

705


What is reflection c#?

675


Can you have more than one namespace in c#?

710


Is overriding of a function possible in the same class?

712


What is the default boolean value in c#?

706