.Net - Explain the difference between a class and a
structure. - June 03, 2009 at 11:00 AM by Shuchi Gauri
Explain the difference between a class and a structure.
Class:
a. It is reference type.
b. Null value can be assigned to a variable in a class
c. It can have destructor.
d. All variables in classes are by default private.
e. Good to be used from architecture view as it provides high flexibility.
Structure:
a. It is value type.
b. Null value assignment is not feasible here.
c. Cannot have destructor.
d. All variables in structures are public.
e. Good to be used for simple data structures.
Also read
ResourceManager class: It provides convenient access to resources that are
culture-correct. The access is provided at run time...........
When there is a need to keep the business logic separate from the User Interface
or when there is some class which is big enough to have multiple number of
developers implement the methods in it............
The Protected Internal access modifier can be accessed by: Members of the
Assembly, The inheriting class, The class itself...............
The read only can be modified by the class it is contained
in................
Static members are not associated with a particular instance of any
class................
The System.Environment class can be used to retrieve information...............
|