Tag: interview question
What are the difference between class and structure in C#?
What are the difference between class and structure in C#? Structure Struct are value types. They can be empty but a null cannot be assigned to Struct Structs cannot contain explicit parameterless constructors. Doesn’t support Inheritance and cannot use the protected or protected internal modifier. A Struct always has a built-in public default constructor. Cannot use the “as” operator. Cannot have a destructor Cannot be…
How to read the complete content of the Text File in C#?
Here’s an easy way to read the complete content of the text file in c# with just one line of code. This is achieved using the System.IO.File.ReadAllText function. Below is a sample code snippet demonstrating how to read the complete content of the Text File in C#? The test1.txt contains the file which needs to be displayed. The test1.txt contains the text “Welcome to Abundantcode.com”….