Found an interesting use of the default keyword in .Net.
default(type) would return the default value for the datatype specified as parameter.
This is nothing but a wrapper around the default values of various types which was intended to be used for Generic classes.
T obj = default(T);
Where T can be any datatype even DataTime and GUID which need to be not NULL.
Using ‘default’ here makes sure the correct initialization takes place.
Published by Rahul Bhatia
Rahul, a self-driven software engineer with a Masters of Computer Application(MCA) degree has a knack for taking up new trends in technology. He has a quest to resolve any technical challenge. He not just codes but understands the deep insights into the technical aspects of any situation. His technical expertise is in Database-driven Web-applications with Web 2.0 User Interface. He also has technical expertise in Web Development technologies.
He topped university in his Master course and received various programming awards. He is a keen learner, passionate programmer and has a good interpersonal and analytical skill set.
Other technical insights - Webservices, Window Service, Ajax, JavaScript, Telerik, Subsonic, Entity Framework, CSLA Architecture, Windows Workflow, API, MVC, .Net core
View all posts by Rahul Bhatia