A nullable Type is a data type is that contain the defined data type or the value of null.
You should note here that here variable datatype has been given and then only it can be used.
This nullable type concept is not comaptible with "var".
I will explain this with syntax in next section.
Declaration:
Any DataType can be declared nullable type with the help of operator "?".
Example of the syntax is as Follows :-
You should note here that here variable datatype has been given and then only it can be used.
This nullable type concept is not comaptible with "var".
I will explain this with syntax in next section.
Declaration:
Any DataType can be declared nullable type with the help of operator "?".
Example of the syntax is as Follows :-
- int? i = null;
So we will have Compile Time error if we are declaring something like: -
- var? i = null;
- var i = 4;
No comments:
Post a Comment