click below
click below
Normal Size Small Size show me how
Java
Java Programming Language
Term | Definition |
---|---|
java programming language | class based, object oriented, and compiles to bytecode and runs on JVM |
conditional statements | if, else if, nested, switch |
if statement | boolean followed by statements |
if else statement | if statement followed by else statement if boolean false |
if else if statement | tests various conditions |
nested if statement | if or else if statement inside another if or else if statement |
switch statement | value checked if it equals a list of values called cases |
loop definition | execute block of code multiple times |
types of loops | while, for, do while, enhanced for |
while loop | executes block of code until boolean is true |
for loop | executes code a set number of times |
do while loop | executes code until boolean false |
enhanced for loop | traverse collection elements like arrays |
enhanced for loop declaration | new variable used in code block |
enhanced for loop expression | array or collection being traversed |
interface | collection of methods that a class implements, all methods are public abstract, variables are public static final |
difference between interface and class | cannot be instantiated, no constructors, abstract methods, no instance fields, extend multiple interfaces |
abstract class | abstract and non abstract methods and is extended and implemented but can't be instantiated |
exception | object is subclass of throwable that wraps an error and contains info about error, state of program and custom info |
exception types | checked, unchecked |
checked expression | handled explicitly, expression throws exception or handles it otherwise program crashes, tested by compiler |
unchecked expression | not handled explicitly, doesn't throw exception, not tested by compiler |
errors | subclass of throwable where most conditions prevent the program from being recovered |
catching exceptions | use try catch finally block |
keyword throws | doesn't handle exception and throws another exception |
keyword throw | either catches or creates a new exception |
keyword finally | always executes code even if there is an exception |
array | contains elements of same type with fixed number of elements randomly accessed |
queue | ordered list of objects that uses fifo or first in first out |
list | expandable array with indexed contents and is built on an array with added functions |
linked list | expandable like a list but is node based |
array list | dynamic array that shrinks and grows, randomly accessed and implements list interface |
set interface | no duplicate elements and has methods from collections class |
map interface | uses key value pairing |
static keyword | makes variables and methods globally available to all classes, uses other static members, and uses dot notation |
final keyword | makes element immutable, methods can't be overridden, and classes can't be extended |
constructor | special method used to set initial value attributes and is called when object of class created |
abstract keyword | makes method or class a template, has no body, extended but can't be instantiated |
stack | like a list but enforces lifo or last in first out |
graph | node based that tracks child nodes and are bidirectional |
binary search tree | sorted tree where left child <= N < right child and is balanced when number of nodes on either side is almost equal |