What is nullable type in c# ?
In C# nullable type allow user to assign null value to primitive data types of C# language. These Value types can take either their normal values or a null value. Its default is null meaning you did not assign any value to it. Moreover, a nullable type can represent the correct range of values for its underlying value type, plus an additional null value.
Example of value types are int, float, double, DateTime, etc.
Can DateTime assigned as null ?
Yes, you can use a nullable DateTime, like this:
More about.....How to DateTime to null ?
What are the types of errors in .Net ?
Error types are fall into one of three categories: syntax errors, run-time errors, and logic errors.
Syntax error (Compilation Errors) : These are errors that prevent your program from running. Most compiler errors are caused by mistakes that you make when typing code. These are the most common type of errors. You can fix them easily in the coding environment as soon as they occur.
Runtime error : These are errors that occur while your program runs. These typically occur when your program attempts an operation that is impossible to carry out.
Logic error :These errors are those that appear once the application is in use. That means, your program may compile and run without error, but the result of an operation may produce a result that you did not expect.
More about.....Difference between Exception and Error
How do you mark a method obsolete ?
It is better to add an annotation to the method using the keyword Obsolete. The Obsolete attribute can be used without arguments, but including an explanation of why the item is obsolete and what to use instead is recommended.
You can also cause the compilation to fail if the method is called from somewhere in code like this:
More about.....Obsolete or Deprecated in NET Framework
- Does C# support multiple Inheritance ?
- What is Process ID ?
- How do I make a DLL in C# ?
- How many ways you can pass values to Windows Services ?
- Can we use "continue" statement in finally block ?
- Difference between the Debug class and Trace class ?
- What is lock statement in C#
- What are dynamic type variables in C#
- What is the difference between is and as operator in C#?
- What are circular references in C#?
- What are the differences between events and delegates in C#
- Explain the types of unit test cases in C#?
- How many types of comments are there in C#?
- What are the various ways to pass parameters to a method in C#?
- What are the different ways to deploy a assembly in net?
- What does assert() method do in c#
- What is literals in C# - Constants and Literals
- What is the use of goto statement in C#
- How can JIT code be faster than AOT compiled code
- Why events have no return types in .NET
- What's the difference between a static method and a non-static method in C#
- What's a weak reference c#?
- What is C# equivalent of the vb.net isNothing function
- What are indexers in C#
- What are generics in c#