Java Intro
Java Variables
Math Functions
Java Operators
Correct Code
100

What do you call this?

public class Main {

class header

100

How many variables are there?

5

100

Math.max does what?

Takes the maximum of two numbers

100

&& is for?

and

100

Int age = 15;

int age = 15;

200

What is this?

System.out.println();

Print statement

200

Which variable is used for words?

String

200

Math.abs(-87) will be?

87

200

OR is coded using?

||

200

String myName = "Sabrina;

String myName = "Sabrina";

300

Difference between print() and println()

print() prints on the same line while println() prints on a new line

300

Int is for decimals. True or False.

False.

300

double sqrt = Math.sqrt(4) is equal to?

2

300

++8 is?

9

300

system.out.Println("hi");

System.out.println("hi");

400

/* */ is used for?

Multi-line comments
400

char uses what type of quotations? Single or Double

Single

400

Math.random Provides a random number between?

(your answer should include "inclusive" & "exclusive")

0 (inclusive) to 1.0 (exclusive)

400

10%3 is?

1
400

char myLet = h;

char myLet = 'h';

500

What is the code for the main method?

public static void main(String[] args)

500

Give an example of a float variable. Provide variable type, variable name, and variable value.

float num1 = 50.0f;

500

If I want to raise 7 to the power of 2, how would I do it using Math functions?

Math.pow(7,2);

500

What will print if:

x=6;

boolean checkAns = !(x>3 || x<5);

System.out.print(checkAns);

False

500

Public class Subject{

public class Subject {

M
e
n
u