# Source File

A text file containing Java code for the compiler to read.

## What is **Source File** in Java?

**Source File** — A text file containing Java code for the compiler to read.

```java
class Greeting {
    String message = "Hello, Java!";
}
```

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

Updated: September 27, 2026

Source: https://www.ask-codey.com/glossary/source-file
