
- C# Basic Tutorial
- C# - Home
- C# - Overview
- C# - Environment
- C# - Program Structure
- C# - Basic Syntax
- C# - Data Types
- C# - Type Conversion
- C# - Variables
- C# - Constants
- C# - Operators
- C# - Decision Making
- C# - Loops
- C# - Encapsulation
- C# - Methods
- C# - Nullables
- C# - Arrays
- C# - Strings
- C# - Structure
- C# - Enums
- C# - Classes
- C# - Inheritance
- C# - Polymorphism
- C# - Operator Overloading
- C# - Interfaces
- C# - Namespaces
- C# - Preprocessor Directives
- C# - Regular Expressions
- C# - Exception Handling
- C# - File I/O
- C# Advanced Tutorial
- C# - Attributes
- C# - Reflection
- C# - Properties
- C# - Indexers
- C# - Delegates
- C# - Events
- C# - Collections
- C# - Generics
- C# - Anonymous Methods
- C# - Unsafe Codes
- C# - Multithreading
- C# Useful Resources
- C# - Questions and Answers
- C# - Quick Guide
- C# - Useful Resources
- C# - Discussion
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
- Related Articles
- Int32.GetTypeCode Method in C# with Examples
- UInt64.GetTypeCode() Method in C# with Examples
- UInt32.GetTypeCode() Method in C# with Examples
- Int16.GetTypeCode Method in C# with Examples
- Int64.GetTypeCode Method in C# with Examples
- UInt16.CompareTo() Method in C# with Examples
- UInt16.Equals Method in C# with Examples
- UInt16.GetHashCode() Method in C# with Examples
- UInt16.ToString Method in C# with Examples
- UInt16.MaxValue Field in C# with Examples
- UInt16.MinValue Field in C# with Examples
- MathF.Tan() Method in C# with Examples
- MathF.Tanh() Method in C# with Examples
- MathF.Truncate() Method in C# with Examples
- MathF.Sin() Method in C# with Examples

Advertisements