Finals Study Flashcards
How many bits in a byte
8 bits
Name 2 character encoding standards
ASCII and Unicode
How many characters can ASCII handle
256 characters
How many characters can Unicode handle
65,536 characters (256^2)
What is a byte’s address
the numbered location where the byte resides
what kind of code can a CPU execute
machine code
is machine code a low or high level language
machine code is considered “low-level” language
what is an algorithm
a finite sequence of instructions for solving a problem or performing a task
How are algorithms typically expressed
in English of pseudocode
how to create a new scanner
Scanner keyboard = new Scanner(System.in);
name the primitive data types:
int, double, boolean, char, float, long, short
is java case sensitive
yes
what are the arithmetic operators
+, -, *, /
what is an example of an assignment variable
=
what are the compound assignment operators
+=, -=, *=, /=, %=
what is a conditional ternary operator
?
incrementing/ decrementing operators
++, –
what are the logical operators
!, &&, ||
what are the relational operators
<=, >=, ==. !=, <, >
do switch statements require a default statement
nope
how do conditional ternary operators work
condition ? implement if true : implement if false
what CANNOT a controlling expression be in a switch statement
a floating point number or a range
anything you can do with a for loop, you can do for a while loop and…
vice versa applies as well
are instance variables usually set as public or private
private
why do we need getter/accessor methods
to access the private instance variables
what do setter/mutator methods do
change the values of the private instance variables
what does private instance variables do
preserves the state of an object
in the UML class diagrams, what does the minus sign represent
represents private
in the UML class diagrams, what does the plus sign represent
represents public
when does an external method call occur
when a method is called outside of its class
what is a non static method call
object followed by a dot followed by the method call
String name = s.getName();
what is a static method call
class name followed by dot followed by method call
double result = Math.log();
what do variables do in classes
store data
what do methods do in classes
perform actions
can you use == or != with null values
yes because null values still have memory addresses
can you change values declared at static final
no they are considered constants and cannot be changed
can you change values declared at static
yes
what are static variables also called
class variables
what are static/instance variables also called
fields or data members
do wrapper classes have default constructors or set methods
nope
methods are blocks of code that should be
used and reused