Java ( Code Academy) Flashcards

1
Q

The Java Virtual Machine

A

is which can ensure the same Java code can be run on different operating systems and platforms.

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

Each file has one

A

primary class named after the file

For example: Our class name: HelloWorld and our file name: HelloWorld.

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

Inside the class we had a

A

main() method which lists our program tasks

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

String[] args is a

A

placeholder for information we want to pass into our program.

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

System.out.println is

A

whenever we want the program to create a new line on the screen after outputting a value

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

System.out.println

System is a

A

built-in Java class that contains useful tools for our programs.

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

System.out.println

Out is

A

short for “output”

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

System.out.println

println is

A

short for “print line”

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

System.out.print

A

is different from ….println, this type f print statement outputs everything on the same line
For example:
System.out.print(“Hello “);
System.out.print(“World”);

output:
Hello World

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

Java is a compiled programming language meaning the code we write in a .java file is

A

transformed into byte code by a compiler before it is executed by the Java Virtual Machine on your computer.

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

A compiler is a program that translates

A

human-friendly programming languages into other programming languages that computers can execute.

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

Compilation helped us catch

A

an error

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

we can compile a .java file from

A

the terminal with the command javac

e.g javac Whales.java

If the file compiles successfully, this command produces an executable class

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

We run the executable with the command:

A

(java + file_name): java Whales

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

When terminal shows no errors, which indicates a successful compilation. Then we now have two files:

A
  • Welcome.java, our original file with Java syntax
  • Welcome.class, our compiled file with Java bytecode, ready to be executed by the Java Virtual Machine.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly