C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
.NET
ADO.NET
Android
ASP.NET
C#
Databases & DBA
Design Patterns & Practices
iOS
Java
OOP/OOD
SharePoint
Software Testing
Web Development
WPF
View All
3
Reply
What is Nullable values types?
Satheesh Kumar Pilli
11y
1.4k
0
Reply
Delete Row
Delete Column
Insert Link
×
Insert
Cancel
Embed YouTube Video
×
Width (%)
Height (%)
Insert
Cancel
Table Options
×
Rows
Columns
First row as header
Create Table
Insert Image
×
Selected file:
Alignment
Left
Center
Right
Select an image from your device to upload
Upload to Server
Cancel
Submit
Simply nullable value type have ability to store null value. To declare a nullable value type we need to suffix the type name with "?"Eg-string str=null; //Valid int p=null; //Invalid int? p=null; //Valid
Rahul Prajapat
10y
0
As we know that, the value type has default value as 0 and reference type has default value as NULL. the convention is that, we cannot assign NULL to value types. But, while working with the databases, it might be have NULL values, because in databases, it is allowed. So, to do this, we have to explicitly assign the NULL values to the Value Types. this can be done by suffixing the ? sign to the type as:- int? i = NULL; then the value type int i will store the NULL value. this is called as Nullable Value Types.
Navratna Pawale
11y
0
In earlier versions of c# it is not possible to store null values under value types(eg int, float, char...). But in c# 2.0 it is possible to store null values under value types also which gives you more flexibility while communicating with database.To declare a nullable value type we need to suffix the type name with "?"Eg-string str=null; //Valid int p=null; //Invalid int? p=null; //Valid
Satheesh Kumar Pilli
11y
0
What is Implicit typed variable (var) in c#?
Value type v/s Reference type?
Message