Recall & Review
beginner
What is the basic structure of a Java program?
A Java program has a class with a <code>main</code> method inside. The <code>main</code> method is where the program starts running.Click to reveal answer
beginner
What does
System.out.println() do in Java?It prints text or values to the screen and moves to the next line, so you can see output from your program.
Click to reveal answer
beginner
Why do we need the
public static void main(String[] args) method?This method is the entry point of any Java program. The computer looks for it to start running your code.
Click to reveal answer
beginner
What is a class in Java?A class is like a blueprint or a container that holds code. Every Java program needs at least one class.Click to reveal answer
beginner
How do you save and run a Java program?
Save the file with a
.java extension and the same name as the class. Then use javac to compile and java to run it.Click to reveal answer
What keyword starts the main method in a Java program?
✗ Incorrect
The main method starts with the keyword
public to make it accessible.Which method prints text to the console in Java?
✗ Incorrect
System.out.println() prints text and moves to a new line.What file extension should a Java source file have?
✗ Incorrect
Java source files must be saved with the
.java extension.What is the name of the method where Java starts running your program?
✗ Incorrect
Java looks for the
main() method to begin execution.Which command compiles a Java program?
✗ Incorrect
Use
javac to compile Java source code into bytecode.Explain the role of the
main method in a Java program.Think about where the computer looks first to run your code.
You got /3 concepts.
Describe the steps to write, save, compile, and run a simple Java program.
Consider the full process from typing code to seeing output.
You got /4 concepts.