What does this Java code mean?

Everything from the /* ... to .... */ is a comment
A comment is ignored by the computer when compiling or running the program
A comment is a note to people looking at the program to explain or remember information.
Every program should have a note telling who wrote it, when, and what it's about.

Every Java program is part of a class.
This class is called OldHelloWorld
public classes are ready to run

public static void main(String[] args) is the standard starting method for every Java program
public = it is open and you can run it
static = you do not have to create an object to run it, it can just run as it is
void = no information comes out of this method, when it's done, it's done
main = the standard main program method name to start a Java program
(String[] args) = a place where you can send information into the program before it runs

{ } curly brackets define the beginning and ending of a section of code

System.out.println means display information from the System out to the screen
"Hello world" is in quotes because it is a literal String
Literal strings are words or sentences that are treated like one solid piece

See if you understand the Java code:

Fill in the blanks Choose your answers
  True False  

1. The name of the method that is the standard starting method for all Java program is

4. System.out.println displays information on the screen

2. "Hello world" is in quotes because it is a string.

True False  
5. void means no information goes into this program

3. A is a note to people looking at the program to explain or remember information.

True False  
6. Things that are public can be run

Click Submit and then hold down Atl and press Prnt Scrn to get a screenshot.

< Back to main Finch page