Professional Documents
Culture Documents
CS171017 Assignment1 C# PDF
CS171017 Assignment1 C# PDF
Ans: The .NET framework is a managed, type safe environment for application
development and execution.
The.NET Framework consists of two main components:
.NET class Library: .NET framework contains multiple classes that are readily
available for developers. The classes in the FCL (framework class library) are
grouped under multiple namespaces.
A Value Type holds the data within its own memory allocation and a Reference Type
contains a pointer to another memory location that holds the real data. Reference
Type variables are stored in the heap while Value Type variables are stored in the
stack.
Ans: Use the Imports keyword (Visual Basic .NET) or the using keyword (Visual
C#) to make a .NET Framework namespace visible to your application.
Ans: Garbage collector of .NET tries to compact the memory in such a way as to
increase the working space required for heap. The class GC of .NET class library
controls the garbage collector. The core task of performing a collection is executed
by the GC’s optimizing engine that determines the best time to perform collection
based on allocations being made.
5. Briefly describe what members are and list the four types of
members?
Ans: Members are the parts of a class or a structure that hold data or implement
functionality. The primary member types are fields, properties, methods, and
events.
Ans: The constructor is the method that initializes a class or structure and is run
when a type is first instantiated. It is used to set default values and perform other
tasks required by the class. A destructor is the method that is run as the object is
being reclaimed by garbage collection. It contains any code that is required for
cleanup of the object.
7. Briefly explain the difference between public, internal and private
access levels as they apply to user-defined types and member?
Ans: Because a Shared (static) member belongs to the type rather than to any
instance of the type, you can access the member without first creating an instance
of the type.