VARTYPESFUNCTIONS Flashcards
What is a Java Package?
Creates a namespace into which you clan place your Java classes that are closely related to each other.
In what order are statements executed?
In the order in which they are written into the program, know are sequential flow of control.
What are primitive types?
Basic building blocks of other types: numbers, characters, booleans.
What are reference types?
Combines primitive and other references to complete more complex structures, like strings.
What are literals?
A value typed directly into code.
What is a variable?
A name for a location in memory.
What are some variable rules?
Cannot be used before declared.
Cannot be used before a value is assigned.
A value of the correct type must be assigned.
Can be changed at any time.
Trying to assign the wrong type is a syntax error.
What is scope?
Refers to the part of the program in which a variable may be used.
Out of scope variables cause syntax errors.
Trying to declare a second variable with same name does as well.
What is an expression?
Tells the computer how to compute a value. Combines one or more values together using operators.
What is a function?
Encapsulates a block of statements, and each time you want to execute those, you call the function.
public static void sayMyName() {
System.out.print.ln(“Bobby”);
}
What are parameters?
Input values a function needs to do it’s work.
Type must be declared.
Are arguments to the function
What are return values?
All functions must declare a return type. Type of value to be returned when fn is called.
Void return type means there is not value returned.
Otherwise, if declared, it must return a value of that type.
What goes into a JavaDoc?
A description of the function.
The name and purpose of each parameter.
The return type (if any) and a description of the expected values
What type of variable do you need to do arithmetic?
Floats.