Java
File Structure
Printing
Errors and Exceptions
Computer Programs and Architecture
100

Which type of file is named with a .java?

Source file

100

If I have a source file named Car.java, what should the class declaration look like?

public Car {

}

100

What is printed with

System.out.println("Hello");

System.out.println("World");?

Hello

World

100

Name the three types of errors/exceptions

- compile error

- runtime error

- logic error

100

What is a program?

A sequence of instructions and decisions.

200

Which type of file is named with a .class?

Class files

200

What does each class contain?

Methods

200

What is printed with 

System.out.print("Hello");

System.out.println("World");

Hello World

200

Which type of error/exception will allow your code to compile and run?

Logic error

200
What is software?

The programs that the computer executes.

300

What is javac?

Java compiler

300

What is needed for a class declaration?

- Access level modifier (ex: private, public)

- Class name

300

What is printed with System.out.print(5 + 7);?

12

300

What type of exception/error will not allow your code to compile?

Compile error

300

What is hardware?

The physical computer and peripheral devices

400

What is the jvm?

Java virtual machine

400

If I have a source file named Car.java, what will the compiled file be named?

Car.class

400

What is printed with System.out.print("3 * 4");?

3 * 4

400
What type of error will allow your code to compile, but not finish running?

Runtime error

400

What is a peripheral device?

A device that connects with the computer

500
What type of code is your source code compiled into?

Bytecode

500

How is the main method declaration written?

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

500

How would you print the following?

B

Y

E

System.out.println("B");

System.out.println("Y");

System.out.println("E");

500

What type of error/exception is created by this line of code?

System.out.println(1/0);

Run-time error (division by zero)

500

What are the two general types of storage?

- primary storage/memory

- secondary storage

M
e
n
u