Hello World! Flashcards
Print Line
System.out.println()
This is a print line that prints to the console.
Print Line
Explain each part of the Print Line
System.out.println()
System is a class from the core library
out is an object that controls the output
println() is a method associated with that object that receives a single argument
Comments
How would you write a single line comment?
// I am a single comment!
Comments
How would you write a multi-line comment?
/*
And I am a
multi-line comment!
*/
main( ) method
In Java every application must have a _____() method. All other methods are invoked from here.
main( )
main( ) method
What is the signature method of the main( ) method?
**public static void main(String[] args) **{
}
main( ) method
True or False:
A main( ) method accepts a single argument: an array of elements of type String.
True
Class
What does a class represent?
A single concept.
Class
A Java program must have how many classes?
One
Class
The class name must have the same name as the program’s _____ name.
filename
Compiling Java
When compiling a program, each class is converted into what type of file?
.class file
Compiling Java
A .class file is also know as ?
byte code
Compiling Java
What type of Virtual Machine is used to run the byte code?
Java Virtual Machine (JVM)
Compiling Java
How would you compile the class file Hello?
javac hello.java
Compiling Java
How would you execute the compiled file?
java hello