Term
Major Hardware Components
(6) |
|
Definition
Central processing unit (CPU) Memory (main memory) Storage devices (disks and CD) Input devices (mouse & keyboards) Output devices (monitors and printers) communication devices (modems and network interface cards |
|
|
Term
A computer's components are interconnected by a subsystem called ____
Where is it built into in personal computers? |
|
Definition
|
|
Term
CPU
What does it stand for/what does it do?
What components does it have? |
|
Definition
Central processing unit
it's the computer's brain
retrieves instructions from the memory and executes them.
2 components -> 1. control unit - controls and coordinates the actions of the other components. 2. arithmetic/logic unit - preforms numeric operations and logic operations |
|
|
Term
|
Definition
the part of the CPU that performs the reading and executing of instructions.
a CPU can have more than one core |
|
|
Term
|
Definition
the minimum storage unit in a computer
A byte is 8 bits
every byte in the memory has an unique address |
|
|
Term
|
Definition
| binary digits (1 or 0) that the computer reads |
|
|
Term
|
Definition
consists of an ordered sequence of bytes for storing programs as well as data that the program is working with.
the area for executing a program. a program has to be moved to the memory before it can be executed by the CPU |
|
|
Term
|
Definition
RAM
bytes in the memory can be access in any order so memory can also be referred to as RAM |
|
|
Term
|
Definition
| used to permanently store data and programs. hard disk drives are encased inside the computer |
|
|
Term
|
Definition
| translates source code into machine code for execution. |
|
|
Term
|
Definition
most important program that urns on a computer
manages and controls a computer's activities |
|
|
Term
|
Definition
Integrated Development Environment
rapidly developing programs. |
|
|
Term
|
Definition
Application Program Interface
aka - library contains predefined classes and interfaces for developing Java programs.
define Java standards |
|
|
Term
|
Definition
a program written in a high-level language
because a computer can't execute the program directly (has to go through the compiler) |
|
|
Term
|
Definition
every Java program has to have at least one class
classes start with a capital letter |
|
|
Term
|
Definition
data structure has to be surrounded by double quotes sequence of characters |
|
|
Term
|
Definition
| every statement ends with a semi-colon |
|
|
Term
| reserved words or keywords |
|
Definition
have a specific meaning to the compiler and can't be user for other purpose in the program
examples - class, public, static, void |
|
|
Term
|
Definition
documents what the program is and how it's built help programmers communicate with one another
ignored by the compiler
// line comment (one line) // /* more than one line yippee */ |
|
|
Term
|
Definition
each block begins with an open and ends with a close brace
public class Welcome{ public static void main(String[ ]args) { System.out.println("Welcome to Java"); } } |
|
|
Term
|
Definition
|
|
Term
|
Definition
| an error that causes a program to terminate abnormally |
|
|
Term
| compile error or syntax error |
|
Definition
| an error caught by the compiler |
|
|
Term
|
Definition
| something that makes the program run unexpectedly |
|
|
Term
|
Definition
names for naming elements such as variables, constants, methods, classes, and pacakges in a program
CAN"T BE TRUE/FALSE or NULL |
|
|
Term
|
Definition
sequence of characters that consists of letters, digitts, underscores, and dollar signs
AN INDENTIFIER MUST START WITH A LETTER OR UNDRESCORE
can't be a reserved word |
|
|
Term
|
Definition
used to store data in a program declare variable is to tell the compiler what type of data a variable can hold. |
|
|
Term
|
Definition
|
|
Term
| named constant or constant |
|
Definition
represents permanent data that never changes
declared using the keyword final |
|
|
Term
| four different integer types |
|
Definition
|
|
Term
|
Definition
| lower case letter for the first word then camel case |
|
|
Term
|
Definition
| capital for the first word camel case after that |
|
|
Term
|
Definition
|
|
Term
|
Definition
|
|
Term
|
Definition
| -2147483648 to -2147483647 |
|
|
Term
|
Definition
|
|
Term
|
Definition
|
|
Term
|
Definition
|
|
Term
|
Definition
multiplication, division, and remainders are applied first
if multiple occur - leff to right
addition and subtraction are applied last |
|
|
Term
|
Definition
++var
increment var by 1, and use the new value in the statement
int j = ++i;
int j is 2, i is 2 |
|
|
Term
|
Definition
int j = i++ int j is 1 , i is 2
increment var by 1 but use the original var value in the statement |
|
|
Term
|
Definition
decrement var by 1 and use the new var value in the statement
int j = --i; j is 0 and i is 0 |
|
|
Term
|
Definition
var --
decrement var by 1 and use the original var value in the statement
int j = i --; j is 1, i is 0 |
|
|
Term
|
Definition
an operation that converts one data type into another data type
(newdatatype)variable |
|
|
Term
|
Definition
when the number is too large for the data type value
if you add one to the int max it goes to the negative value |
|
|
Term
|
Definition
| automatically moves the scanner down after returning the current line |
|
|
Term
|
Definition
| what comes before the space |
|
|
Term
|
Definition
statements that let you choose between actions with alternative courses
if/else |
|
|
Term
|
Definition
| expression that evaluates to true or false |
|
|
Term
|
Definition
let you compare two things
< <= > >= == != |
|
|
Term
|
Definition
| is either assigned true or false |
|
|
Term
|
Definition
a construct that allows a program to specify alternative paths of execution
if(boolean expression) { statements; } |
|
|
Term
|
Definition
can be used for generating numbers Math.random() for generating a random double between 0.0 and 1.0 |
|
|
Term
logical operators what they are what it means |
|
Definition
they are -> !, &&, ||, ^ (exclusive or)
when a statement is determined by several conditions these operators help evaluate it to true or false |
|
|
Term
|
Definition
!(condition && condition2) is the same as !condition1 || !condition2 is the same as !condition1 && !condition 2 |
|
|
Term
|
Definition
executes statements based on the value of a variable or an expression
checks all cases and executes the statements in the matched case
switch(switch expression) { case value1: statement1; break; case value2: statement2; break; } |
|
|
Term
|
Definition
the expression much yield a value of char, byte, short, int or String and must always be in parenths
value1 .. value N must have the same data type as the switch expression
the default case cab be used to preform actions when non of the specific cases match the switch expression
keyword break is option. Immediately ends the switch statement
when the case vallue does match the statements starting from that case are executed until either a break of the end of the switch statement is reached. |
|
|
Term
|
Definition
evaluates an expression based on a condition
if/else
can also be written
boolean-expression ? expression1 : expression2; |
|
|
Term
|
Definition
| catch errors by reading the program |
|
|
Term
|
Definition
== is a comparison = is an assignment |
|
|
Term
| all binary operators are left associative |
|
Definition
| assignment operators are right associative |
|
|
Term
|
Definition
also known as lazy operations && and ||
because if one if false the statement is false(&&) and if one is true the statement is true (||) |
|
|
Term
|
Definition
| skips the current iteration of a for, while , or do-while loop |
|
|
Term
|
Definition
seems like besting if/else as well as for loops can be stopped with a break statement
In this case, if condition1 is true then the inner if is executed. If condition1 is false then the nested if is not executed. if ( condition1 ) { if ( condition2) { } else { } } else { } |
|
|
Term
|
Definition
|
|
Term
| escape sequence to have double quotes |
|
Definition
|
|
Term
| backspace escape sequence |
|
Definition
|
|
Term
|
Definition
|
|
Term
|
Definition
|
|
Term
|
Definition
|
|
Term
|
Definition
|
|
Term
|
Definition
to read a string from the console, invoke next() on the scanner object
reads a string that ends with a whitespace character |
|
|
Term
|
Definition
| reads an entire line of text |
|
|
Term
|
Definition
| returns this string's substring from the indexes of the first excluding the last |
|
|
Term
|
Definition
| a method that can only be invoked from a specific object |
|
|
Term
|
Definition
| can be invoked without using an object |
|
|
Term
|
Definition
repeats the statement while the condition is true
syntax
while(loop condition) { body; } |
|
|
Term
|
Definition
| when it's known exactly how many times the loop body need to be executed. |
|
|
Term
|
Definition
| a loop that will continuously run because the condition never becomes false. |
|
|
Term
|
Definition
the idea that the programmer either runs the condition one less or one too many times than encessary due to the operation
<= instead of < |
|
|
Term
|
Definition
| the special input value needed to end a loop |
|
|
Term
|
Definition
a loop design that uses a sentinel value to control it's execution
needs the specific value to end input) |
|
|
Term
|
Definition
| the number of iterations is known before we start exectuing |
|
|
Term
|
Definition
| the number of iterations is not known before execution starts |
|
|
Term
|
Definition
executes the loop body first and then checks the loop continuation condition
syntax
do{ statements; }while(condition); |
|
|
Term
|
Definition
for (initial value; continuation condition; action after iteration) { body statements; } |
|
|
Term
|
Definition
| used in for loops and is used to control how many times the body is executed |
|
|
Term
| scope of for loop counter |
|
Definition
within that loop
LOOK THIS UP |
|
|
Term
|
Definition
| when user input or soemthing causes it to be true - specific value |
|
|
Term
|
Definition
| while and for loops are because the continuation condition is checked before the loop body is executed |
|
|
Term
|
Definition
| do while loop is called this because the condition is checked after the loop body is executed |
|
|
Term
|
Definition
consisted of an outer loop and one or more inner loops each time the outer loop is repeated, the inner loops are reentered |
|
|
Term
|
Definition
| specifies the modifiers, return value type, method name and parameters |
|
|
Term
|
Definition
| a method that returns a value |
|
|
Term
|
Definition
|
|
Term
| actual parameter or argument |
|
Definition
| what is passed into the method |
|
|
Term
|
Definition
the method name and the parameeter list together
parameters are optional |
|
|
Term
|
Definition
each time a method is invoked an AR is created taht stores parameters and variables for the method and places the AR in an area of memory known as a call stack.
Call stack stores activation records last-in first out |
|
|
Term
|
Definition
execution stack, runtime stack, or machin stack
when a method calls another method, the caller's activation record is kept intact, and a new activation record is created for the new method called. When a method finished its work and returns to its caller, its activiation record is removed from the call stack. |
|
|
Term
|
Definition
| enables you to define the methods with the same name as long as their signatures are different. |
|
|
Term
|
Definition
| the process of diving a problem into subproblems to make it more manageable |
|
|
Term
| information hiding or encapsulation |
|
Definition
| when teh details fo the implemenation are encapulsated in the method and hidden form teh client who envokes the method |
|
|
Term
|
Definition
a simple but incomplete version of a method enables you to quickly build the frame work of the program |
|
|
Term
|
Definition
must declare a variable to refernce the array and specify the array's element type
elementType[ ] arrayRefVar;
double[] myList;
can do double myList[]; but the other way is preferred |
|
|
Term
|
Definition
| double[] myList = {valye,value} |
|
|
Term
|
Definition
|
|
Term
| how many bytes in a double |
|
Definition
|
|
Term
|
Definition
an object that represents an error or a condition that prevents execution from proceeding normally
thrown from a method caller of the method can catch and handle the exception |
|
|
Term
|
Definition
occur while a program is running if the virtual machine detects an operation that is impossible to carry out
ex. InputMisMatchException |
|
|
Term
|
Definition
the code in the try block is what is executed normally catch block is executed to handle the exception. |
|
|
Term
|
Definition
the throw statement is analogous to a method call but instead of calling a method, it calls the catch block.
MAIN DIFFERENCE after the exeception is handled in the catch block the program executes the next statement after the catch (it doesn't go back to the throw statement) |
|
|
Term
| root class for exceptions |
|
Definition
|
|
Term
|
Definition
three major types
1. system errors 2. exceptions 3 run time exceptions |
|
|
Term
|
Definition
| thrown by the JVM and are internal system errors. You can't really do anything to change this you jave to notify your user and exit gracefully |
|
|
Term
| exceptions (compile time exceptions) |
|
Definition
| describes errors caused by your program and external circumstances. These errors can be caught and handled by your program. |
|
|
Term
|
Definition
| are represented in the RuntimeException class which describes programming(logic) errors such as bad casting, out of bounds, etc. Gernally thrown by the JVM. |
|
|
Term
|
Definition
| exceptions the compiler doesn't force the program to deal with. You don't have to have a try/catch block. runtime exceptions are unchecked. |
|
|
Term
|
Definition
| the compiler forces the programmer to check and deal with them in a try-catch block or declare it in a method header. |
|
|
Term
| Exception handling model has three operations |
|
Definition
1. declaring an exception **method2() throws Exception**{ if(an error occurs) { 2. throwing exception *throw new Exception();* } }
method1(){ try{ invoke method2; } catch(Exception ex) { 3. Catch exception
* Process exception;* } } |
|
|
Term
|
Definition
every method must state the types of checked exceptions it might throw. this is declaring exceptions
if more than one exception ->
public void myMethod() throws Exception1,Exception2,...,ExceptionN |
|
|
Term
|
Definition
| a program that detects an error can create an instance of an appropriate exception type and throw it. |
|
|
Term
|
Definition
end clause of a try catch block that's always execute whether an exception occurred or not
1. if no exception arises in the try block it's the next thing executed 2. if the statement causes an exception in the try block that is caught in a catch bloc, the rest of the try statements are skipped and the finally clause is executed right after the try statement.
3. if one of the statements causes an exception that is not caught in any catch block the otehr statements in the try block are skipped, the finally clause is executed, and the exception is passed to the caller of this method. |
|
|
Term
|
Definition
| when you throw an original excpetion alone with a new exception ( with additional information) |
|
|
Term
| absolute filename (or full name) |
|
Definition
contains a file name with its complete path and and drive letter
machine dependent |
|
|
Term
|
Definition
in relation to the current working directory.
Welcome.java is a relative filename |
|
|
Term
|
Definition
contains the methods for obtaining file and directory properties and for renaming and deteing files and directores
DOES NOT CONTAIN THE METHODS FOR READING AND WRITING FILE CONTENTS. |
|
|
Term
|
Definition
| a subclass (child class) inherits certain attributes from a super (parent class) the sub class can have other methods and attributes as well |
|
|
Term
|
Definition
lets the compiler know that one class is inheriting methods from the other
syntax: subclass superclass public class Circle extends GeometricObject |
|
|
Term
| private member in superclass |
|
Definition
| can't be accessed by any other class. |
|
|
Term
|
Definition
inheritance is used to model this type of relationship
has to fit the phrase subclass is a superclass
A student is a Person |
|
|
Term
|
Definition
java doesn't allow multiple inheritance multiple inheritance can be acheived through interfaces, but NOT IN CLASSES only one class can be a parent. |
|
|
Term
|
Definition
the method must be defined in the subclass using the same signature and the same return type as its superclass
instance method can only be overridden if its accessible. PRIVATE METHODS CAN'T BE OVERRIDDEN
STATIC METHODS CANT BE OVERRIDDEN if a static method defined int eh super class is redefined in a subclass, the method defined in the superclass is hidden.
hidden method can be invoked using the syntax SuperClassName.staticMethodName |
|
|
Term
|
Definition
| define multiple methods with the same name but different signatures. |
|
|
Term
|
Definition
Object o = new Student()
thats okay because an instance of Student is an instance of Object |
|
|
Term
|
Definition
you can't just say Student b = o; because an Object might not be an instance of Student. so the compiler will give an error so you have to be explicit
Student b = (Student) o |
|
|
Term
|
Definition
| it's always legal to cast an instance of a subclass to a variable of a superclass because an instance of a subclass is always an isntance of its supercalss. |
|
|
Term
|
Definition
| explicit casting has to be used because the compiler has to know for sure the object is an instance of the right class. |
|
|
Term
|
Definition
| to check if a object is an instance of the right class you can use the instanceof operator |
|
|
Term
|
Definition
| can be used to store a list of objects
MUST BE AN object
so ArrayList is a no go but
ArrayList list = new ArrayList<>();
is good |
|
|
Term
|
Definition
the separation of class implementation from the use of the class.
details of implementation are encapsulated and hidden from |
|
|
Term
| classes are also known as an abstract data type |
|
Definition
| because you can find something out about hte object without knowing exactly how it's executed |
|
|
Term
|
Definition
| a data structure that holds data in a list-in, first out fashion |
|
|
Term
|
Definition
instances of all wrapper classes are immutable each numeric wrapper class has named constants can construct a wrapper object either from a primitive data type value or from a string representing that numerical value. |
|
|
Term
|
Definition
| the compiler will automatically box a primitve value that appears in a context requiring an object that appears in a context requiring a primitive value. |
|
|
Term
|
Definition
creating an instance of an object can create as many as needed |
|
|
Term
|
Definition
| class that contains the main method. |
|
|