Get the default value for various variables - CSharp Language Basics

CSharp examples for Language Basics:Variable

Description

Get the default value for various variables

Demo Code

using System;// www  .  j a  v  a2s.co m
class Program
{
   static void Main(string[] args)
   {
      Console.WriteLine($"{default(int)}"); // 0
      Console.WriteLine($"{default(bool)}"); // False
      Console. WriteLine($"{default(DateTime)}"); // 1/01/0001 00:00:00
   }
}

Result


Related Tutorials