Java Introduction
Mint.java writes one word. The word is mint. This page is that file, and the line the screen shows when the file runs is mint.
Java is a language for programs you save in a file and run from a terminal. The terminal is the window where you type a command and read the lines it writes back. This course stays with those files. You write a file, run it, and read the screen. You are not building a web page here.
The file is named Mint.java. Here it is.
public class Mint {
public static void main(String[] args) {
System.out.println("mint");
}
}
When this file runs, the screen shows mint. mint is the word between the quotes in System.out.println("mint"). That line is the one that writes the screen. The quotes stay in the file. They mark the word as text. They are not written on the screen. Take the quotes away and mint is no longer that word of text. This file keeps the quotes.
The screen has one line. The line is mint. There is no second line. Nothing is written beside mint on that line.
The first line of the file is public class Mint. Look at the screen again. The screen does not show Mint. It shows mint. The capital M in Mint and the small m in mint are not the same word. The screen uses the word between the quotes, not the word on the first line.
You can see more lines in the file, including public static void main(String[] args). Those lines are part of the file. They are not written on the screen. A later page reads them one at a time. On this page, the line you are responsible for is System.out.println("mint"), and the screen line is mint.
You are reading the file. You are not running it yet. The next page installs Java on the computer and runs Mint.java. After that run, the screen is mint.
Read the file once more before you leave. The writing line is System.out.println("mint"). The word between the quotes is mint. The screen line is mint, with no quotes and no second line. The word Mint on the first line stays off the screen.
You can now look at this file and say what the screen will show. The screen will be mint, written by System.out.println("mint"). The next page installs Java and runs the file.
The screen will be mint
The screen shows mint. System.out.println("mint") writes that word. The quotes are not on the screen. The word Mint on the first line is not on the screen. There is no second line.
🧠 Test Your Knowledge
Test Your Knowledge
Challenge yourself with this interactive quiz and see how well you understand the topic
📝 Instructions
- Read each question carefully
- Select the best answer for each question
- You can retake the quiz as many times as you want
- Your progress will be shown at the top