# Type Casting

Explicitly converting a value to another compatible type.

## 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;
    }
}
```

Level: Novice · [More Java terms at this level](https://www.ask-codey.com/glossary/subjects/java/novice)

Updated: September 27, 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
