
- 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
What are explicit type conversions in C#?
Explicit conversions require a cast operator.
These conversions are done explicitly by users using the pre-defined functions.
Let us see an example to cast double to int −
Example
using System; namespace Demo { class Program { static void Main(string[] args) { double d = 345.78; int i; Console.WriteLine("double: "+d); i = (int)d; Console.WriteLine("int: "+i); Console.ReadKey(); } } }
- Related Articles
- What are implicit and explicit type conversions in C language?
- What are implicit type conversions in C#?
- Explicit type casting operator in C++
- What is the difference between implicit and explicit type conversion in C#?
- Explicit Type Casting in Python Language
- What does the explicit keyword mean in C++?
- What are type qualifiers in C++?
- What are type specifiers in C++?
- What are primitive data type in C++?
- Use of explicit keyword in C++\n
- What does explicit wait perform?
- Different ways for Integer to String Conversions in C#
- What are the differences between implicit and explicit waits in Selenium with python?
- What is explicit implementation and when to use in the interface in C#?
- What are the differences between Widening Casting (Implicit) and Narrowing Casting (Explicit) in Java?

Advertisements