Variables
Operations
Strings & Index
Logic
Methods Definitions
100

What are the two categories of variables?

Primitive and non-primitive

100

What does 5 % 2 equal?

1

100

What is a String and is it a primitive data type?

A sequence of characters; NOT a primitive data type

100

true && false

false

100

What is a main method?

A special method that successfully runs your other methods

200

Name a non-primitive variable

Strings

200

Given a = 3 and b = 5

If a += b;

what does System.out.println(a); return?

8

200

What is one way to declare a string that says: Welcome to Coding Power?

String way1= "Welcome to Coding Power";

String way2= new String ("Welcome to Coding Power");

200

Given: x = 10;

if (x%2 ==0) return true;  

else return false;

true

200

What is the correct way to call a method?

myMethod()

300

If the sky is blue, and Sona is mute, name three of the eight primitive variables

boolean, byte, char, short, int, long, float, double (any 3)

300

Given a = 1; b = 4; and c = 10;

If a+=b; c-=a;

What does System.out.println(c);

5

300

What is "This is our final class!".length()?

24

300

(true || false) && (true && true)

true

300

What does a return type do?

Extra Credit (200 points): List 5 return types.

Indicates what will be returned after a method is ran.

EC: int, double, boolean, String, void (also long, float, byte, char, short)

400

What is the proper format for declaring and initializing a variable?

[variable type] [variable name] = [value];

400

Given num1 += num2, num1 += num3

What is equivalent to?

num1 = num1 + num2 + num3

400

What is str.length() - the index of the last character?

1

400

for(int i = 10; i>0; i--){ System.out.print(i);}

10987654321

400

What is the structure of the method header?

Access modifier, return type, method name (parameters)

500

What are the requirements for a valid variable name?

First character must be lowercase letter, no spaces, Camel Case (optional)

500

What is (100 % 6) % 2 equal to?

0

500

String str = "Jeopardy";

for(int i = str.length()-1;i >= 0;i--)  System.out.print(str.substring(i,i+1);

What does this do?

ydrapoeJ

500

int count = 0;

for(int i = 0 ; i<5; i++){

System.out.print("no");

count++; }

nonononono

500

What is the proper main method header?

public static void main(String [] args)