Nullable value types in c#

Nullable value types are newly added in c# 2.0 .which allows storing null values under valuetypes.because before this feature.we can never store a null value under value type.In any programinng language.They can be stored only in reference types.

To declare a variable as nullable.we need to suffix with a question mark at the time of declaration.

   Example: string str=null;          //valid

            int x=null;               //invalid

            int? x=null;              //valid.
About Author: author 4 + years of Information Technology experience in understanding and analyzing the software and hardware engineering requirements, onsite and offshore management of product development. Expert work on design and development for windows,web,mobile Expert knowledge of C#,ADO.NET, ASP.Net MVC, ENTITY FRAMEWORK, LINQ,COLLECTIONS, JAVASCRIPT,AngularJs 1.0,Angular2, Jquery,Jquery-Ajax, SQL SERVER, XAML,Windows phone 8.1 Good knowledge of WCF-Restful services,WCF, WEB API-Services ,Web- Services,MIcrosoft-Azure,JUICE UI,HTML,CSS,AJAX Read More...

Join him on Google+ | Facebook | Linkedin

No comments