C# net is a programming language widely used for Windows and many other operating systems. Its popularity has created a high demand for skilled employees in the software testing industry. C# net interview questions are likely to be technical and require critical thinking to answer so it’s best to prepare and practice for your interview. In this article, we list 15 common C# net interview questions and sample answers to review in preparation for your interview.
How to prepare for your C# net interview questions
Before you interview and demonstrate your coding skills, you want to adequately prepare and review. Here are some steps to help you prepare for your C# net interview:
Review and improve coding skills
If you want to leave a good impression on your interviewer, you should review C# coding to increase your familiarity with it. C# net is vast and it may not be possible to review everything, but it may be helpful to take a couple of online quizzes. The categories you will likely need to review are:
- .css-1g5t2dl{font-family:”Noto Sans”,”Helvetica Neue”,”Helvetica”,”Arial”,”Liberation Sans”,”Roboto”,”Noto”,sans-serif;font-weight:inherit;color:#595959;font-size:1.25rem;line-height:1.5;color:#2d2d2d;margin-bottom:0;font-size:1rem;margin-top:1.5rem;}html[lang=ja] .css-1g5t2dl{font-size:1rem;line-height:1.75;}@media screen and (min-width: 62em){.css-1g5t2dl{font-size:1.25rem;margin-top:2.5rem;}}
Principles of OOP
- .css-1g5t2dl{font-family:”Noto Sans”,”Helvetica Neue”,”Helvetica”,”Arial”,”Liberation Sans”,”Roboto”,”Noto”,sans-serif;font-weight:inherit;color:#595959;font-size:1.25rem;line-height:1.5;color:#2d2d2d;margin-bottom:0;font-size:1rem;margin-top:1.5rem;}html[lang=ja] .css-1g5t2dl{font-size:1rem;line-height:1.75;}@media screen and (min-width: 62em){.css-1g5t2dl{font-size:1.25rem;margin-top:2.5rem;}}
Abstract vs. encapsulation
- .css-1g5t2dl{font-family:”Noto Sans”,”Helvetica Neue”,”Helvetica”,”Arial”,”Liberation Sans”,”Roboto”,”Noto”,sans-serif;font-weight:inherit;color:#595959;font-size:1.25rem;line-height:1.5;color:#2d2d2d;margin-bottom:0;font-size:1rem;margin-top:1.5rem;}html[lang=ja] .css-1g5t2dl{font-size:1rem;line-height:1.75;}@media screen and (min-width: 62em){.css-1g5t2dl{font-size:1.25rem;margin-top:2.5rem;}}
Encapsulation
- .css-1g5t2dl{font-family:”Noto Sans”,”Helvetica Neue”,”Helvetica”,”Arial”,”Liberation Sans”,”Roboto”,”Noto”,sans-serif;font-weight:inherit;color:#595959;font-size:1.25rem;line-height:1.5;color:#2d2d2d;margin-bottom:0;font-size:1rem;margin-top:1.5rem;}html[lang=ja] .css-1g5t2dl{font-size:1rem;line-height:1.75;}@media screen and (min-width: 62em){.css-1g5t2dl{font-size:1.25rem;margin-top:2.5rem;}}
Shadowing and overriding
- .css-1g5t2dl{font-family:”Noto Sans”,”Helvetica Neue”,”Helvetica”,”Arial”,”Liberation Sans”,”Roboto”,”Noto”,sans-serif;font-weight:inherit;color:#595959;font-size:1.25rem;line-height:1.5;color:#2d2d2d;margin-bottom:0;font-size:1rem;margin-top:1.5rem;}html[lang=ja] .css-1g5t2dl{font-size:1rem;line-height:1.75;}@media screen and (min-width: 62em){.css-1g5t2dl{font-size:1.25rem;margin-top:2.5rem;}}
Types of polymorphism in C#
Principles of OOP
Principles of OOP
Abstract vs. encapsulation
Abstract vs. encapsulation
Encapsulation
Encapsulation
Shadowing and overriding
Shadowing and overriding
Types of polymorphism in C#
Types of polymorphism in C#
Research the role
Research your role as well as the company you are interviewing in order to have a more accurate idea of the work you will be expected to complete. Study all requirements and qualifications to ensure you can confidently fill the role.
Build experience
After you review C# net, you may need to build your experience. Try working on personal projects that develop your coding skills and fill in any knowledge gaps. You may also try building experience with open source projects and volunteer work to practice with C#.
Refine whiteboarding skills
Whiteboarding questions are important as they show that you have a working and applicable knowledge of C# net. Try writing out codes on paper so that you are used to resolving problems by hand, to prepare for whiteboarding in the interview. After you write the code, you may want to test the code later to make sure it is correct.
Practice mock interviews
Practicing with a mentor, friend or family member will help you answer the C# net interview questions more confidently and accurately, while mentally preparing you for the interview environment.
Common C# net interview questions
When you interview for jobs that include Microsoft web/application development or related careers, it’s important to have a strong working knowledge of C# net. Your interviewer will likely ask you the basics of your C# background, as well as more in-depth questions to gauge your experience. Here are some common C# net interview questions you may be asked:
- .css-1g5t2dl{font-family:”Noto Sans”,”Helvetica Neue”,”Helvetica”,”Arial”,”Liberation Sans”,”Roboto”,”Noto”,sans-serif;font-weight:inherit;color:#595959;font-size:1.25rem;line-height:1.5;color:#2d2d2d;margin-bottom:0;font-size:1rem;margin-top:1.5rem;}html[lang=ja] .css-1g5t2dl{font-size:1rem;line-height:1.75;}@media screen and (min-width: 62em){.css-1g5t2dl{font-size:1.25rem;margin-top:2.5rem;}}
What are the different types of classes in C#?
- .css-1g5t2dl{font-family:”Noto Sans”,”Helvetica Neue”,”Helvetica”,”Arial”,”Liberation Sans”,”Roboto”,”Noto”,sans-serif;font-weight:inherit;color:#595959;font-size:1.25rem;line-height:1.5;color:#2d2d2d;margin-bottom:0;font-size:1rem;margin-top:1.5rem;}html[lang=ja] .css-1g5t2dl{font-size:1rem;line-height:1.75;}@media screen and (min-width: 62em){.css-1g5t2dl{font-size:1.25rem;margin-top:2.5rem;}}
What is Managed and Unmanaged code?
- .css-1g5t2dl{font-family:”Noto Sans”,”Helvetica Neue”,”Helvetica”,”Arial”,”Liberation Sans”,”Roboto”,”Noto”,sans-serif;font-weight:inherit;color:#595959;font-size:1.25rem;line-height:1.5;color:#2d2d2d;margin-bottom:0;font-size:1rem;margin-top:1.5rem;}html[lang=ja] .css-1g5t2dl{font-size:1rem;line-height:1.75;}@media screen and (min-width: 62em){.css-1g5t2dl{font-size:1.25rem;margin-top:2.5rem;}}
What is a Class and an Object?
- .css-1g5t2dl{font-family:”Noto Sans”,”Helvetica Neue”,”Helvetica”,”Arial”,”Liberation Sans”,”Roboto”,”Noto”,sans-serif;font-weight:inherit;color:#595959;font-size:1.25rem;line-height:1.5;color:#2d2d2d;margin-bottom:0;font-size:1rem;margin-top:1.5rem;}html[lang=ja] .css-1g5t2dl{font-size:1rem;line-height:1.75;}@media screen and (min-width: 62em){.css-1g5t2dl{font-size:1.25rem;margin-top:2.5rem;}}
Explain Code compilation in C#.
- .css-1g5t2dl{font-family:”Noto Sans”,”Helvetica Neue”,”Helvetica”,”Arial”,”Liberation Sans”,”Roboto”,”Noto”,sans-serif;font-weight:inherit;color:#595959;font-size:1.25rem;line-height:1.5;color:#2d2d2d;margin-bottom:0;font-size:1rem;margin-top:1.5rem;}html[lang=ja] .css-1g5t2dl{font-size:1rem;line-height:1.75;}@media screen and (min-width: 62em){.css-1g5t2dl{font-size:1.25rem;margin-top:2.5rem;}}
What is the difference between Virtual method and Abstract method?
- .css-1g5t2dl{font-family:”Noto Sans”,”Helvetica Neue”,”Helvetica”,”Arial”,”Liberation Sans”,”Roboto”,”Noto”,sans-serif;font-weight:inherit;color:#595959;font-size:1.25rem;line-height:1.5;color:#2d2d2d;margin-bottom:0;font-size:1rem;margin-top:1.5rem;}html[lang=ja] .css-1g5t2dl{font-size:1rem;line-height:1.75;}@media screen and (min-width: 62em){.css-1g5t2dl{font-size:1.25rem;margin-top:2.5rem;}}
Explain Namespaces in C#.
- .css-1g5t2dl{font-family:”Noto Sans”,”Helvetica Neue”,”Helvetica”,”Arial”,”Liberation Sans”,”Roboto”,”Noto”,sans-serif;font-weight:inherit;color:#595959;font-size:1.25rem;line-height:1.5;color:#2d2d2d;margin-bottom:0;font-size:1rem;margin-top:1.5rem;}html[lang=ja] .css-1g5t2dl{font-size:1rem;line-height:1.75;}@media screen and (min-width: 62em){.css-1g5t2dl{font-size:1.25rem;margin-top:2.5rem;}}
Explain Polymorphism.
- .css-1g5t2dl{font-family:”Noto Sans”,”Helvetica Neue”,”Helvetica”,”Arial”,”Liberation Sans”,”Roboto”,”Noto”,sans-serif;font-weight:inherit;color:#595959;font-size:1.25rem;line-height:1.5;color:#2d2d2d;margin-bottom:0;font-size:1rem;margin-top:1.5rem;}html[lang=ja] .css-1g5t2dl{font-size:1rem;line-height:1.75;}@media screen and (min-width: 62em){.css-1g5t2dl{font-size:1.25rem;margin-top:2.5rem;}}
How is Exception Handling implemented in C#?
- .css-1g5t2dl{font-family:”Noto Sans”,”Helvetica Neue”,”Helvetica”,”Arial”,”Liberation Sans”,”Roboto”,”Noto”,sans-serif;font-weight:inherit;color:#595959;font-size:1.25rem;line-height:1.5;color:#2d2d2d;margin-bottom:0;font-size:1rem;margin-top:1.5rem;}html[lang=ja] .css-1g5t2dl{font-size:1rem;line-height:1.75;}@media screen and (min-width: 62em){.css-1g5t2dl{font-size:1.25rem;margin-top:2.5rem;}}
What are Boxing and Unboxing?
- .css-1g5t2dl{font-family:”Noto Sans”,”Helvetica Neue”,”Helvetica”,”Arial”,”Liberation Sans”,”Roboto”,”Noto”,sans-serif;font-weight:inherit;color:#595959;font-size:1.25rem;line-height:1.5;color:#2d2d2d;margin-bottom:0;font-size:1rem;margin-top:1.5rem;}html[lang=ja] .css-1g5t2dl{font-size:1rem;line-height:1.75;}@media screen and (min-width: 62em){.css-1g5t2dl{font-size:1.25rem;margin-top:2.5rem;}}
What is an Array used for?
- .css-1g5t2dl{font-family:”Noto Sans”,”Helvetica Neue”,”Helvetica”,”Arial”,”Liberation Sans”,”Roboto”,”Noto”,sans-serif;font-weight:inherit;color:#595959;font-size:1.25rem;line-height:1.5;color:#2d2d2d;margin-bottom:0;font-size:1rem;margin-top:1.5rem;}html[lang=ja] .css-1g5t2dl{font-size:1rem;line-height:1.75;}@media screen and (min-width: 62em){.css-1g5t2dl{font-size:1.25rem;margin-top:2.5rem;}}
What is an Escape Sequence? Name the sequences in C#.
- .css-1g5t2dl{font-family:”Noto Sans”,”Helvetica Neue”,”Helvetica”,”Arial”,”Liberation Sans”,”Roboto”,”Noto”,sans-serif;font-weight:inherit;color:#595959;font-size:1.25rem;line-height:1.5;color:#2d2d2d;margin-bottom:0;font-size:1rem;margin-top:1.5rem;}html[lang=ja] .css-1g5t2dl{font-size:1rem;line-height:1.75;}@media screen and (min-width: 62em){.css-1g5t2dl{font-size:1.25rem;margin-top:2.5rem;}}
What are the basic String Operations?
- .css-1g5t2dl{font-family:”Noto Sans”,”Helvetica Neue”,”Helvetica”,”Arial”,”Liberation Sans”,”Roboto”,”Noto”,sans-serif;font-weight:inherit;color:#595959;font-size:1.25rem;line-height:1.5;color:#2d2d2d;margin-bottom:0;font-size:1rem;margin-top:1.5rem;}html[lang=ja] .css-1g5t2dl{font-size:1rem;line-height:1.75;}@media screen and (min-width: 62em){.css-1g5t2dl{font-size:1.25rem;margin-top:2.5rem;}}
What is Serialization?
- .css-1g5t2dl{font-family:”Noto Sans”,”Helvetica Neue”,”Helvetica”,”Arial”,”Liberation Sans”,”Roboto”,”Noto”,sans-serif;font-weight:inherit;color:#595959;font-size:1.25rem;line-height:1.5;color:#2d2d2d;margin-bottom:0;font-size:1rem;margin-top:1.5rem;}html[lang=ja] .css-1g5t2dl{font-size:1rem;line-height:1.75;}@media screen and (min-width: 62em){.css-1g5t2dl{font-size:1.25rem;margin-top:2.5rem;}}
What are the different types of Delegates?
What are the different types of classes in C#?
What are the different types of classes in C#?
What is Managed and Unmanaged code?
What is Managed and Unmanaged code?
What is a Class and an Object?
What is a Class and an Object?
Explain Code compilation in C#.
Explain Code compilation in C#.
What is the difference between Virtual method and Abstract method?
What is the difference between Virtual method and Abstract method?
Explain Namespaces in C#.
Explain Namespaces in C#.
Explain Polymorphism.
Explain Polymorphism.
How is Exception Handling implemented in C#?
How is Exception Handling implemented in C#?
What are Boxing and Unboxing?
What are Boxing and Unboxing?
What is an Array used for?
What is an Array used for?
What is an Escape Sequence? Name the sequences in C#.
What is an Escape Sequence? Name the sequences in C#.
What are the basic String Operations?
What are the basic String Operations?
What is Serialization?
What is Serialization?
What are the different types of Delegates?
What are the different types of Delegates?
1. What are the different types of classes in C#?
Example: “The different types of class in C# are:
- .css-1g5t2dl{font-family:”Noto Sans”,”Helvetica Neue”,”Helvetica”,”Arial”,”Liberation Sans”,”Roboto”,”Noto”,sans-serif;font-weight:inherit;color:#595959;font-size:1.25rem;line-height:1.5;color:#2d2d2d;margin-bottom:0;font-size:1rem;margin-top:1.5rem;}html[lang=ja] .css-1g5t2dl{font-size:1rem;line-height:1.75;}@media screen and (min-width: 62em){.css-1g5t2dl{font-size:1.25rem;margin-top:2.5rem;}}
Partial class – Allows its members to be divided or shared with multiple .cs files. It is denoted by the keyword ‘Partial’.
- .css-1g5t2dl{font-family:”Noto Sans”,”Helvetica Neue”,”Helvetica”,”Arial”,”Liberation Sans”,”Roboto”,”Noto”,sans-serif;font-weight:inherit;color:#595959;font-size:1.25rem;line-height:1.5;color:#2d2d2d;margin-bottom:0;font-size:1rem;margin-top:1.5rem;}html[lang=ja] .css-1g5t2dl{font-size:1rem;line-height:1.75;}@media screen and (min-width: 62em){.css-1g5t2dl{font-size:1.25rem;margin-top:2.5rem;}}
Sealed class – It is a class that cannot be inherited. To access the members of a sealed class, we need to create the object of the class. It is denoted by the keyword ‘Sealed’.
- .css-1g5t2dl{font-family:”Noto Sans”,”Helvetica Neue”,”Helvetica”,”Arial”,”Liberation Sans”,”Roboto”,”Noto”,sans-serif;font-weight:inherit;color:#595959;font-size:1.25rem;line-height:1.5;color:#2d2d2d;margin-bottom:0;font-size:1rem;margin-top:1.5rem;}html[lang=ja] .css-1g5t2dl{font-size:1rem;line-height:1.75;}@media screen and (min-width: 62em){.css-1g5t2dl{font-size:1.25rem;margin-top:2.5rem;}}
Abstract class – It is a class whose object cannot be instantiated. The class can only be inherited. It should contain at least one method. It is denoted by the keyword ‘abstract’.
- .css-1g5t2dl{font-family:”Noto Sans”,”Helvetica Neue”,”Helvetica”,”Arial”,”Liberation Sans”,”Roboto”,”Noto”,sans-serif;font-weight:inherit;color:#595959;font-size:1.25rem;line-height:1.5;color:#2d2d2d;margin-bottom:0;font-size:1rem;margin-top:1.5rem;}html[lang=ja] .css-1g5t2dl{font-size:1rem;line-height:1.75;}@media screen and (min-width: 62em){.css-1g5t2dl{font-size:1.25rem;margin-top:2.5rem;}}
Static class – It is a class that does not allow inheritance. The members of the class are also static. It is denoted by the keyword ‘static’. This keyword tells the compiler to check for any accidental instances of the static class.”
Partial class – Allows its members to be divided or shared with multiple .cs files. It is denoted by the keyword ‘Partial’.
Partial class – Allows its members to be divided or shared with multiple .cs files. It is denoted by the keyword ‘Partial’.
Sealed class – It is a class that cannot be inherited. To access the members of a sealed class, we need to create the object of the class. It is denoted by the keyword ‘Sealed’.
Sealed class – It is a class that cannot be inherited. To access the members of a sealed class, we need to create the object of the class. It is denoted by the keyword ‘Sealed’.
Abstract class – It is a class whose object cannot be instantiated. The class can only be inherited. It should contain at least one method. It is denoted by the keyword ‘abstract’.
Abstract class – It is a class whose object cannot be instantiated. The class can only be inherited. It should contain at least one method. It is denoted by the keyword ‘abstract’.
Static class – It is a class that does not allow inheritance. The members of the class are also static. It is denoted by the keyword ‘static’. This keyword tells the compiler to check for any accidental instances of the static class.”
Static class – It is a class that does not allow inheritance. The members of the class are also static. It is denoted by the keyword ‘static’. This keyword tells the compiler to check for any accidental instances of the static class.”
2. What is Managed and Unmanaged code?
Example: “Managed code is a code that is executed by CLR (Common Language Runtime). It is called ‘managed code’ because of the .Net framework which uses the garbage collector internally to clear up unused memory. ‘__Unmanaged code’ is any code that is executed by the application runtime of any other framework apart from .Net. The application runtime will take care of security, memory and other performance operations.”
3. What is a Class and an Object?
Example: “A ‘Class’ is an encapsulation of methods and properties that are used to represent an entity in real-time. Class brings all of the instances together in a single unit. An ‘Object’ is an instance of a Class, or a block of allocated memory that can be stored in the form of Variables, Array or a Collection.”
4. Explain Code compilation in C#
Example: *“Code compilation has four steps which include:
- .css-1g5t2dl{font-family:”Noto Sans”,”Helvetica Neue”,”Helvetica”,”Arial”,”Liberation Sans”,”Roboto”,”Noto”,sans-serif;font-weight:inherit;color:#595959;font-size:1.25rem;line-height:1.5;color:#2d2d2d;margin-bottom:0;font-size:1rem;margin-top:1.5rem;}html[lang=ja] .css-1g5t2dl{font-size:1rem;line-height:1.75;}@media screen and (min-width: 62em){.css-1g5t2dl{font-size:1.25rem;margin-top:2.5rem;}}
Compiling source code to Managed code by C# compiler
- .css-1g5t2dl{font-family:”Noto Sans”,”Helvetica Neue”,”Helvetica”,”Arial”,”Liberation Sans”,”Roboto”,”Noto”,sans-serif;font-weight:inherit;color:#595959;font-size:1.25rem;line-height:1.5;color:#2d2d2d;margin-bottom:0;font-size:1rem;margin-top:1.5rem;}html[lang=ja] .css-1g5t2dl{font-size:1rem;line-height:1.75;}@media screen and (min-width: 62em){.css-1g5t2dl{font-size:1.25rem;margin-top:2.5rem;}}
Executing the assembly by CLR
- .css-1g5t2dl{font-family:”Noto Sans”,”Helvetica Neue”,”Helvetica”,”Arial”,”Liberation Sans”,”Roboto”,”Noto”,sans-serif;font-weight:inherit;color:#595959;font-size:1.25rem;line-height:1.5;color:#2d2d2d;margin-bottom:0;font-size:1rem;margin-top:1.5rem;}html[lang=ja] .css-1g5t2dl{font-size:1rem;line-height:1.75;}@media screen and (min-width: 62em){.css-1g5t2dl{font-size:1.25rem;margin-top:2.5rem;}}
Combining the new code into assemblies
- .css-1g5t2dl{font-family:”Noto Sans”,”Helvetica Neue”,”Helvetica”,”Arial”,”Liberation Sans”,”Roboto”,”Noto”,sans-serif;font-weight:inherit;color:#595959;font-size:1.25rem;line-height:1.5;color:#2d2d2d;margin-bottom:0;font-size:1rem;margin-top:1.5rem;}html[lang=ja] .css-1g5t2dl{font-size:1rem;line-height:1.75;}@media screen and (min-width: 62em){.css-1g5t2dl{font-size:1.25rem;margin-top:2.5rem;}}
Loading the Common Language Runtime (CLR)”
Compiling source code to Managed code by C# compiler
Compiling source code to Managed code by C# compiler
Executing the assembly by CLR
Executing the assembly by CLR
Combining the new code into assemblies
Combining the new code into assemblies
Loading the Common Language Runtime (CLR)”
Loading the Common Language Runtime (CLR)”
5. What is the difference between Virtual method and Abstract method?
Example: “A Virtual method must always have a default implementation. An Abstract method does not have an implementation. An override keyword is not necessary here, though it can be used.”
6. Explain Namespaces in C#
Example: “Namespaces are used to organize large code projects. “System” is the most widely-used namespace in C#.”
7. Explain Polymorphism
Example: “In programming, polymorphism means the same method but different implementations. It contains two types, Compile-time and Runtime. Compile time polymorphism is accomplished by operator overloading. Runtime polymorphism is accomplished by overriding. An example would be: a class has a method Void Add(), polymorphism is accomplished by Overloading the method, that is, void Add(int a, int b), void Add(int add) are all overloaded methods.”
8. How is exception handling implemented in C#?
Example: “Exception handling is done using four keywords in C#:
- .css-1g5t2dl{font-family:”Noto Sans”,”Helvetica Neue”,”Helvetica”,”Arial”,”Liberation Sans”,”Roboto”,”Noto”,sans-serif;font-weight:inherit;color:#595959;font-size:1.25rem;line-height:1.5;color:#2d2d2d;margin-bottom:0;font-size:1rem;margin-top:1.5rem;}html[lang=ja] .css-1g5t2dl{font-size:1rem;line-height:1.75;}@media screen and (min-width: 62em){.css-1g5t2dl{font-size:1.25rem;margin-top:2.5rem;}}
Try – contains a block of code that checks an exception.
- .css-1g5t2dl{font-family:”Noto Sans”,”Helvetica Neue”,”Helvetica”,”Arial”,”Liberation Sans”,”Roboto”,”Noto”,sans-serif;font-weight:inherit;color:#595959;font-size:1.25rem;line-height:1.5;color:#2d2d2d;margin-bottom:0;font-size:1rem;margin-top:1.5rem;}html[lang=ja] .css-1g5t2dl{font-size:1rem;line-height:1.75;}@media screen and (min-width: 62em){.css-1g5t2dl{font-size:1.25rem;margin-top:2.5rem;}}
Catch – is a program that catches an exception with the help of exception handler.
- .css-1g5t2dl{font-family:”Noto Sans”,”Helvetica Neue”,”Helvetica”,”Arial”,”Liberation Sans”,”Roboto”,”Noto”,sans-serif;font-weight:inherit;color:#595959;font-size:1.25rem;line-height:1.5;color:#2d2d2d;margin-bottom:0;font-size:1rem;margin-top:1.5rem;}html[lang=ja] .css-1g5t2dl{font-size:1rem;line-height:1.75;}@media screen and (min-width: 62em){.css-1g5t2dl{font-size:1.25rem;margin-top:2.5rem;}}
Finally – is a block of code written to execute even if an exception is not caught.
- .css-1g5t2dl{font-family:”Noto Sans”,”Helvetica Neue”,”Helvetica”,”Arial”,”Liberation Sans”,”Roboto”,”Noto”,sans-serif;font-weight:inherit;color:#595959;font-size:1.25rem;line-height:1.5;color:#2d2d2d;margin-bottom:0;font-size:1rem;margin-top:1.5rem;}html[lang=ja] .css-1g5t2dl{font-size:1rem;line-height:1.75;}@media screen and (min-width: 62em){.css-1g5t2dl{font-size:1.25rem;margin-top:2.5rem;}}
Throw – Throws an exception when a problem occurs.”
Try – contains a block of code that checks an exception.
Try – contains a block of code that checks an exception.
Catch – is a program that catches an exception with the help of exception handler.
Catch – is a program that catches an exception with the help of exception handler.
Finally – is a block of code written to execute even if an exception is not caught.
Finally – is a block of code written to execute even if an exception is not caught.
Throw – Throws an exception when a problem occurs.”
Throw – Throws an exception when a problem occurs.”
9. What are Boxing and Unboxing?
Example: “Converting a value type to reference type is called ‘Boxing’. Explicit conversion of the same reference type that is created by boxing back to value type is called ‘Unboxing’.”
10. What is an Array used for?
Example: “An Array is used to store multiple variables of the same type and is a collection of variables stored in a contiguous memory location.”
11. What is an Escape Sequence? Name the sequences in C#
Example: “An Escape sequence is denoted by a backslash (). The backslash indicates that the character that follows it should be interpreted literally or that it is a special character. An escape sequence is considered as a single character.”
12. What are the basic String Operations?
Example: “The basic String Operations are: Concatenate, Modify, Search, Compare.”
13. What is Serialization?
Example: “Serialization converts a code to its binary format using a process. After it is converted to bytes, it can be easily stored and written to a disk. Serializations are useful so that the original form of the code isn’t lost and it can be retrieved later on.”
14. What are the different types of Delegates?
Example: “The different types of Delegates are: Single Delegate, Multicast Delegate and Generic Delegate.”