repl.it
@kironroy/

generics

C#

No description

fork
loading
Files
  • main.cs
  • Book.cs
  • BookList.cs
  • DiscountCalculator.cs
  • List.cs
  • main.exe
  • notes.txt
  • Nullable.cs
  • Product.cs
  • Sample.cs
  • Utlities.cs
main.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
using System;


// https://www.tutorialspoint.com/csharp/csharp_generics.htm


namespace Generics
{
    class Program
    {
        static void Main(string[] args)
        {
            var number = new Nullable<int>();
            Console.WriteLine("Has Value ?" + number.HasValue);
            Console.WriteLine("Value: " + number.GetValueOrDefault());
        }
    }
}