.Net Interview Questions and Answers For Graduates Part-5
Garbage collection is a heap-management strategy where a run-time component takes responsibility for managing the lifetime of the memory used by objects. This concept is not new to .NET – Java and many other languages/runtimes have used garbage collection for some time.
42. What is serialization?
Serialization is the process of converting an object into a stream of bytes.Deserialization is the opposite process, i.e. creating an object from a stream of bytes. Serialization/Deserialization is mostly used to transport objects (e.g. during remoting), or to persist objects (e.g. to a file or database).
43. Where do you add an event handler?
It’s the Attributesproperty, the Add function inside that property. e.g.btnSubmit.Attributes.Add(“onMouseOver”,”someClientCode();”)
44. What do you mean by authentication and authorization?
Authentication is the process of validating a user on the credentials(username and password) and authorization performs after authentication. After Authentication a user will be verified for performing the various tasks, It access is limited it is known as authorization.
45. What is portable executable (PE) ?
The file format used for executable programs and for files to be linked together to form executable programs
46. Differences between DLL and EXE?
1.These are outbound file.
2.Only one .exe file exists per application.
3..Exe cannot be shared with other applications.
1.These are inbound file .
2.Many .dll files may exists in one application.
3. .dll can be shared with other applications.
47. What is shadowing?
Shadowing is either through scope or through inheritance. Shadowing through inheritance is hiding a method of a base class and providing a new implementation for the same. This is the default when a derived class writes an implementation of a method of base class which is not declared as overridden in the base class. This also serves the purpose of protecting an implementation of a new method against subsequent addition of a method with the same name in the base class.’shadows’ keyword is recommended although not necessary since it is the default.
48. What is Method Overriding? How to override a function in C#?
An override method provides a new implementation of a member inherited from a base class. The method overridden by an override declaration is known as the overridden base method. The overridden base method must have the same signature as the override method.
Use the override modifier to modify a method, a property, an indexer, or an event. You cannot override a non-virtual or static method. The overridden base method must be virtual, abstract, or override.
49. Differences between dataset.clone and dataset.copy?
Clone – Copies the structure of the DataSet, including all DataTable schemas, relations, and constraints. Does not copy any data.
Copy – Copies both the structure and data for this DataSet.
50. What is the managed and unmanaged code in .net?
The .NET Framework provides a run-time environment called the Common Language Runtime, which manages the execution of code and provides services that make the development process easier. Compilers and tools expose the runtime’s functionality and enable you to write code that benefits from this managed execution environment. Code that you develop with a language compiler that targets the runtime is called managed code; it benefits from features such as cross-language integration, cross-language exception handling, enhanced security, versioning and deployment support, a simplified model for component interaction, and debugging and profiling services.