block comment
the compiler will ignore any text between /* */
class declaration
identifies name, start, and end of the class
class name MUST match file name
main method
controls all the action in the program
System.out
object that generates output to console
output
what the computer makes from the input
what comes out as a result of the code
console
where the output is printed
System.out.print
display whatever is in () on screen but wait at the end of the line for more info to display
System.out.println
display () and move cursor to the next line
compiler
translates the code in the IDE into the output in the console
what kind of programming language is Java
a compiler and interpreter
primitive types
most basic data structure in Java
determines size and type of information
types of primitive types
int
boolean
char
double
float
byte
string literal
an exact sequence of characters enclosed in “ “
not a primitive type
int
represents an integer with up to 2 bil places
boolean
true/false
1 bit; smallest value
double
decimal value up to 15 places
64 bits
float
decimal value up to 6 places
char
character
*c*
syntax/compiler errors
identified when program is compiled
exception/runtime error
occurs while program is running → program terminates abnormally
logic errors
detected after program is run
actual output =/= anticipated output
differences between primitive and non-primitive types
primitive types already exist in Java; non-primitive is hand-made
non-primitive can use methods to perform actions, primitive can’t
variable
a name given to a memory location that holds a specific type of value
type
set of values (a domain) and a set of operations on them
constant/final var
cannot be changed once given a value
compound assignment operators
used in place of “=”
adds a value onto the stated variable
x += 7;
7 will be added onto x
increment/decrement operators
++ adds 1 to the value of a variable/array element
- - subtracts 1
Java is __ oriented
object
object-oriented
organizes software design around data and objects, not functions and logic (i.e. python)
interpreter
translates code line by line