Interview questions

.Net - difference between a class and a structure

Next question>>           Learn .NET
.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.

Next question>>

Also read

Explain the concepts of resource manager class.

ResourceManager class: It provides convenient access to resources that are culture-correct. The access is provided at run time...........

What is partial classess in .net?

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............

Describe the accessibility modifier "protected internal" in C#.

The Protected Internal access modifier can be accessed by: Members of the Assembly, The inheriting class, The class itself...............

What is the difference between const and readonly in C#.NET?

The read only can be modified by the class it is contained in................ 

Explain the use of static members with example using C#.NET.

Static members are not associated with a particular instance of any class................

What is the use of System.Environment class in C#.NET?

The System.Environment class can be used to retrieve information...............



Write your comment - Share Knowledge and Experience


 

 
Latest placement tests
Latest links
 
Latest MCQs
» General awareness - Banking » ASP.NET » PL/SQL » Mechanical Engineering
» IAS Prelims GS » Java » Programming Language » Electrical Engineering
» English » C++ » Software Engineering » Electronic Engineering
» Quantitative Aptitude » Oracle » English » Finance
Home | About us | Sitemap | Contact us | We are hiring