What are the two categories of variables?
Primitive and non-primitive
What does 5 % 2 equal?
1
What is a String and is it a primitive data type?
A sequence of characters; NOT a primitive data type
true && false
false
What is a main method?
A special method that successfully runs your other methods
Name a non-primitive variable
Strings
Given a = 3 and b = 5
If a += b;
what does System.out.println(a); return?
8
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");
Given: x = 10;
if (x%2 ==0) return true;
else return false;
true
What is the correct way to call a method?
myMethod()
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)
Given a = 1; b = 4; and c = 10;
If a+=b; c-=a;
What does System.out.println(c);
5
What is "This is our final class!".length()?
24
(true || false) && (true && true)
true
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)
What is the proper format for declaring and initializing a variable?
[variable type] [variable name] = [value];
Given num1 += num2, num1 += num3
What is equivalent to?
num1 = num1 + num2 + num3
What is str.length() - the index of the last character?
1
for(int i = 10; i>0; i--){ System.out.print(i);}
10987654321
What is the structure of the method header?
Access modifier, return type, method name (parameters)
What are the requirements for a valid variable name?
First character must be lowercase letter, no spaces, Camel Case (optional)
What is (100 % 6) % 2 equal to?
0
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
int count = 0;
for(int i = 0 ; i<5; i++){
System.out.print("no");
count++; }
nonononono
What is the proper main method header?
public static void main(String [] args)