Type Casting

Explicitly converting a value to another compatible type.

What is Type Casting in C#?

Type Casting — Explicitly converting a value to another compatible type.

class TicketCounter
{
    void ConvertValues()
    {
        int tickets = 7;
        double exactTickets = tickets;
        int wholePrice = (int)7.9;
    }
}

Level: Novice · More C# terms at this level

Updated

In other subjects