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

What is the default value of date?

457


What is the difference between array and arraylist c#?

468


How do you declare an interface in c#?

488


What is xml serialization and deserialization in c#?

486


who is a protected class-level variable available to?

546






Why delegates are type safe?

492


What are delegates and why are they required?

512


What is list collection in c#?

525


What is the difference between static class and abstract class in c#?

466


Is arraylist generic in c#?

472


What is sql transaction in c#?

484


What is difference between comparable and comparator?

466


Why do we need properties in c#?

495


What is difference between gridview and form view?

540


Is a decimal an integer?

478