What is the meaning of Immutable?

Immutable means once you create a thing, you cannot modify it. In the context of .NET and programming in general, immutability refers to the characteristic of an object whose state cannot be modified after it is created. Once an immutable object is created, its state remains constant throughout its lifetime. Here’s a more detailed breakdown: … Read more

What is the difference between Hash table and Array list?

Hash table stores data in the form of value pair and name while Array list stores only values. You need to pass name to access value from the Hash table while in Array, you need to pass index number to access value. In Array, you can store only similar type of data type while in … Read more

How to retrieve user name in case of Window Authentication?

System.Environment.UserName. In a .NET interview, if you’re asked how to retrieve the username in the case of Windows Authentication, you would typically use the WindowsIdentity class in conjunction with WindowsPrincipal. Here’s the correct approach: csharpCopy code using System; using System.Security.Principal; class Program { static void Main() { // Retrieve the current Windows identity. WindowsIdentity identity … Read more

What are differences between function and stored procedure in .Net programming language?

The difference between function and stored procedure: Function returns only one value but procedure can return one or more than one value. Function can be used in select statements but procedure cannot be used. Function has only input parameters while Procedure can have an input and output parameters. Exceptions can be handled by try catch … Read more

What is the difference between session object and application object?

The session object is used to maintain the session of each user. For example: If a user enters into the application then he will get a session id. If he leaves from the application then the session id is deleted. If he again enters into the application, he will get a different session id. But … Read more