1/77
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
Hardware
The physical components of a computer.
Software
written programs or procedures or rules and associated documentation pertaining to the operation of a computer system and that are stored in read/write memory
main memory
holds current memory, volatile (goes away)
auxiliary memory
exists once the computer turns off (hard drive)
input
keyboard, mouse, etc.
output
monitor, printer, etc.
RAM
Random Access Memory - is the main memory, and the hard drive is the principal
CPU
(Central Processing Unit) The key component of a computer system, which contains the circuitry necessary to interpret and execute program instructions
1 bit
smallest unit
4 bits
nibble
8 bits
1 byte
1,000 bytes
1 KB
1 million bytes (1,000 kilobytes)
1 MB
1 billion bytes (1,000 megabytes)
1 GB
bytes in larger units are ____
files
Files are organized into ____
folders or directories
machine language
(what the computer understands)- is a "low-level language" which is binary (01001101)
"high-level language"
A programming language like Java that is designed to be easy for humans to read and write.
JVM
Java Virtual Machine, an interpreter for compiled Java bytecodes - translates and runs the Java bytecode
OOP
Object-Oriented Programming- views a program as similarly consisting of objects that can act alone or interact with one another
Encapsulation
packages and hides details
Polymorphism
allows the same program instruction to mean different things in different contexts - one method name causes many different actions
Inheritance
is the way of organizing classes
code HelloWorld
public class HelloWorld{
public static void main(String[] args){
System.out.print("Hello World");
}
}
Variable(s)
store data and/or values
data types
say what the variable is storing
int
whole numbers
double or float
decimals
char
characters (letters)
boolean
true or false
string
words/phrase
primitive types
int, char, double/float
constants
variables that next change in your code - written as:
final int thisNumber = 4;
or
int THIS_NUMBER = 4;
True or false:
Java is case sensitive
true
"keywords" that should NEVER be included in your code
if, public, class, while, for, print, etc.
order of data types by size:
byte-short-int-long-float-double
e notation: 4x10^8
4e^8
"="
the assignment operator, gives a variable a value
"+"
"-"
"*"
"/"
"()"
"%"
math operators
++
increment by 1
--
decrement by 1
Type casting
Converting data from one type to another, e.g., from string to int
//
comments out rest of the line
/ /
comments out multiple lines
if statement operators:
<
>
<=
>=
==
!=
||
&&
respectively:
less than
greater than
less than or equal to
greater than or equal to
equals
does not equal
or
and
lexicographic order
similar to alphabetical order and is sometimes, but not always, the same as alphabetical order - the letters and characters are ordered according to their Unicode sequence
.length ();
returns int of how long the string is
.indexOf();
returns the index of a letter (position, because String starts with index 0)
.equals();
.equalsIgnoreCase();
equality of 2 strings (just like == is for int)
.toUpperCase();
.toLowerCase();
all characters to upper case or lower case
.compareTo();
compares to help with ordering alphabetic characters
-If compare x1 to x2 and returns >0(+) then x1 comes after x2
-If compare x1 to x2 and returns <0(-) then x1 comes before x2
-if compare x1 to x2 and returns 0 then x1 ad x2 are equal
\t
tab
\n
forces to next line
switch statement
allows multi-way branching. In many cases, using a switch statement can simplify a complex combination of if-else statements.
enumerations
limit the amount of values a variable can have
while loop
repeats while the boolean expression is true
do-while loop
same as the while loop expect the body of the loop is executed at least one time
for loop
used typically when you want the body to run a specific number of times
an array
a collection of variables of the same type
double [ ] temp = new double [7];
True or False:
Java arrays start at 0
True
arrays are indexed with ____
int
illegal identifiers
-identifiers cannot have a dot, hyphen, or an asterisk
-identifiers cannot start with a digit
only create ____ scanner object (import java.util.scanner;)
one
True or false:
When naming a constant, you should use upper-case characters in the name with an underscore between the words and the data type at the end of the name.
true
doing int 9 divided by int 10 will give you ___ (an integer answer)
0
the mod (%) operator
gives the remainder of int after after division
strings can be concatenated using the ___ operator
+
"\\\\" = ?
"\\" - 2 characters
tautology
when the expression is always true
contradiction
when the expression is always false
contingency
when the expression has at least one true or false
== is appropriate when...
determining if 2 ints, booleans, or chars have the same value
in lexicographic order numbers come before _____ , and capital letters come before _____
letters ; lowercase
ternary (conditional operator)
useful with print and println statemtents, but not used often
the exit method
System.exit(0);
logic error
errors that are not detected during compilation or while running, but which causes the program to produce incorrect results
runtime error
errors are detected when the program is running, but not during compilation
syntax error
grammatical mistakes in a program