Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Selected Reading
UInt16.GetTypeCode() Method in C# with Examples
The UInt16.GetTypeCode() method in C# is used to return the TypeCode for value type UInt16.
Syntax
Following is the syntax −
public TypeCode GetTypeCode ();
Example
Let us now see an example to implement the UInt16.GetTypeCode() method −
using System;
public class Demo {
public static void Main(){
ushort val1 = 55;
ushort val2 = 100;
TypeCode type1 = val1.GetTypeCode();
TypeCode type2 = val2.GetTypeCode();
Console.WriteLine("Typecode for val1 = "+type1);
Console.WriteLine("Typecode for val1 = "+type2);
}
}
Output
This will produce the following output −
Typecode for val1 = UInt16 Typecode for val1 = UInt16
Example
Let us now see another example to implement the UInt16.GetTypeCode() method −
using System;
public class Demo {
public static void Main(){
ushort val1 = UInt16.MinValue;
ushort val2 = 0;
TypeCode type1 = val1.GetTypeCode();
TypeCode type2 = val2.GetTypeCode();
Console.WriteLine("Typecode for val1 = "+type1);
Console.WriteLine("Typecode for val2 = "+type2);
}
}
Output
This will produce the following output −
Typecode for val1 = UInt16 Typecode for val2 = UInt16
Advertisements
