# Type Casting

*noun*

say it: **“TYPE kas-ting”** **/ˈtaɪp ˌkæstɪŋ/**

Telling Java to treat a value as another type, such as turning a double into an int by writing (int) in front of it.

## What is **Type Casting** in Java?

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

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

## In a sentence

- “**Type casting** 9.99 to an int gave me 9, because the part after the decimal point is dropped.”

Level: Novice · [More Java terms at this level](https://www.ask-codey.com/glossary?category=java&level=1)

Updated: October 26, 2026

## In other subjects

- [Type Casting in C#](https://www.ask-codey.com/glossary/type-casting-c-sharp)

Source: https://www.ask-codey.com/glossary/type-casting
