Hello World! Flashcards

1
Q

Print Line

System.out.println()

A

This is a print line that prints to the console.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Print Line

Explain each part of the Print Line
System.out.println()

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Comments

How would you write a single line comment?

A

// I am a single comment!

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Comments

How would you write a multi-line comment?

A

/*
And I am a
multi-line comment!
*/

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

main( ) method

In Java every application must have a _____() method. All other methods are invoked from here.

A

main( )

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

main( ) method

What is the signature method of the main( ) method?

A

**public static void main(String[] args) **{

}

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

main( ) method

True or False:
A main( ) method accepts a single argument: an array of elements of type String.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Class

What does a class represent?

A

A single concept.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Class

A Java program must have how many classes?

A

One

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Class

The class name must have the same name as the program’s _____ name.

A

filename

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Compiling Java

When compiling a program, each class is converted into what type of file?

A

.class file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Compiling Java

A .class file is also know as ?

A

byte code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Compiling Java

What type of Virtual Machine is used to run the byte code?

A

Java Virtual Machine (JVM)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Compiling Java

How would you compile the class file Hello?

A

javac hello.java

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Compiling Java

How would you execute the compiled file?

A

java hello

How well did you know this?
1
Not at all
2
3
4
5
Perfectly