What is a compiler language? Name an example.
What is an interpreter? Name an example.
What type of language is Java?
What would give this error?
Main method not public.
Forgotten the word “public”
Why would an error occur here?
public static main(String[] args)
Forgetting the word “void”
What is a compile-time error? Name some examples.
What is a runtime error? Can you name some examples.
How can you name a variable?
int a, b;
a = 1234;
b = 99;
int c = a + b;
What are the variables, literals, declaration / assignment / combined statements?
a and b
1234 and 99
int a, b
a = 1234 and b = 99
int c = a + b
What does the word “final” do?
Prevents a variable from being altered.
What is a trace?
A table of variable values after each statement in a code.
What is the difference in declaring a char versus a String?
char uses ‘’ while String uses “”
What is a primitive type? Name an example.
What is a reference type? Name an example.
How do primitive and reference types store data?
Primitive types store actual values while reference types store the reference or “arrow” to an address
Can doubles be assigned integer values?
Yes. The integer is automatically converted to a double.
What is the difference between 5/2.0 and 5.0/2?
They are treated the same. Only one of the numbers has to be a double for the answer to be a double.
What is the difference between 5/0 and 5.0/0?
ArithmeticException vs. Infinity