# Random Number

A value selected by a generator so its next result is difficult to predict casually.

## What is **Random Number** in Java?

**Random Number** — A value selected by a generator so its next result is difficult to predict casually.

```java
class PriceCalculator {
    long roundedPrice(double price) {
        return Math.round(price);
    }
}
```

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

Updated: September 27, 2026

## In other subjects

- [Random Number in C#](https://www.ask-codey.com/glossary/random-number-c-sharp)

Source: https://www.ask-codey.com/glossary/random-number
