Section 1

Preview this deck

AND (&&) operator

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

0

All-time users

0

Favorites

0

Last updated

7 years ago

Date created

Mar 1, 2020

Cards (309)

Section 1

(50 cards)

AND (&&) operator

Front

true only if both operands evaluate to true

Back

Documentation Comments

Front

Special comments that have the appearance of multi-line comments Generate external documentation of source code /* Documentation Comment / Javadoc will ignore all asterisks after the first two

Back

Arithmetic Operator Precedence

Front

1. (* / %) 2. (+ -) Left to right

Back

abstract data type

Front

Collections are abstract data types because they allow abstraction.

Back

2 Hierarchial Collections

Front

Tree, Binary Tree

Back

Method

Front

A set of instructions (collection of statements grouped together) that can be called on an object to perform a function. Parameters may be passed in using parentheses Names should start with a lowercase letter and use camel case

Back

4 types of collections

Front

1. Linear - ordered by position, with one predecessor and one successor 2. Heierarchal - tree structure, where a data item may have one parent and many children 3. Graphs - each data item may have many predecessors and many successors 4. Unordered - in no order, no meaningful way to attribute an item as a successor or pedecessor

Back

Comments

Front

Important to annotate code to describe what code is doing for readability and ease of re-use Ignored by compiler Multi line: / .../ Single line: //

Back

Collection

Front

A group of items that are to be treated as a conceptual unit. May be homogeneeous or heterogeneous Arrays, lists, stacks, queues, heaps, graphs, maps, trees, sets, and bags are all types of colletions

Back

server

Front

An object that RECEIVES a message. Like a bartender who hears a request and responds. AKA abstract data type - client only knows the interface

Back

abstraction

Front

From a user's perspective, collections in Java may be utilized as a means of storing or accessing data without concern for the details of how the collections operate, and are therefore an abstraction. Achieved in java via abstract classes and interfaces

Back

extends

Front

* when a class extends another class, it inherits the behavior of that class * can use the methods of the super class as it's own

Back

abstract methods

Front

methods not tied to any particular object declared without an implementation

Back

OR (||) operator

Front

true if at least one of the operands is true

Back

Object

Front

A run-time entity (instance of a class) with encapsulated variables and methods that allows interaction with the rest of the program through a restricted set of operations. Has behavior, state and identity.

Back

9 Linear collections

Front

List, Stack, Queue, String, Heap, BitSet, StringBuffer, PriorityQueue, SortedCollection

Back

polymorhism

Front

One method, several implementations Different types of objects may understand the same message, but respond in their own way. A superclass may be extended by more than one subclass Each suclass may replace a public or protected method of superclass to customize that behavior

Back

returns

Front

keyword that indicates a method will return a value of a specific type (the return value) after it runs.

Back

Logical operator precedence

Front

1.Parentheses 2. ! 3. && 4. ||

Back

Class

Front

A template that describes the characteristics of objects Might be pre-defined library class or new class Names should start with a capital letter

Back

8 main types of operations on collections

Front

1. Search and retreival 2. Removal 3. Insertion 4. Replacement 5. Traversal 6. Test for equality 7. Determination of size 8. Cloning

Back

client

Front

An object that SENDS a message. Like a customer asking for a drink

Back

Whitespace

Front

Ignored by compiler. Spaces, newlines, returns

Back

preconditions

Front

What must be true before a method is invoked, if that method is to run correctly. State of parameters, instance variables to be accessed.

Back

parameter

Front

*values that can be specified when creating an object or calling a method * Parameters "pass" values to objects and methods

Back

FLOAT data type

Front

* represents numbers with a fractional component * represented internally as four bytes * default number of digits of precision after decimal point: * may instruct program to increase precision using % * initialize with an f * i.e.float length = 3.9f

Back

Equality operators (== and !=)

Front

Used for comparison to determine if two values are identical Used on boolean, char, and int data types float?....

Back

XOR () operator

Front

true if only one of the operands is true

Back

abstract classes

Front

classes are defined as abstract via the abstract keyword abstract classes cannot be instantiated to use an abstract class, you must inherit it from another class via extends keyword - it is not implemented in the superclass A class containing at least one abstract method is an abstract class Useful when the method output is unique to each subclass but has no meaningful representation in superclass. i.e. Animal Class - makeSound() unique to each object An interface is a class that contains ONLY abstract methods

Back

main() method

Front

*public static void main(String [] args) * A built-in main method present in every java program *code inside this method gets executed

Back

Constructor method

Front

A method in every class that creates a blank template Instructs the class to set up the initial state of the object Same name as class May be overloaded Does not need to be declared public Does not need void keyword, even though constructors never return a value Java creates a default if constructor not in code may call other constructor methods

Back

Relational operator precedence

Front

< <= > >= Left to right

Back

postcondition

Front

What will be true after a method has finished execution. State of parameters, instance variables that were just changed.

Back

Package naming convention

Front

Package names should be unique so distributed packages do not find conflicts with files the end user might already have. Convention: reverse the name of the website, ie. com.webitename.packageName

Back

1 Graph collection

Front

Graph

Back

CHAR data type

Front

represents a single character to print to screen, enclose in single quotes ie. 'G' represented internally as one byte

Back

NOT (!) operator

Front

negates the value of the operand

Back

package

Front

a group of classes that are related in some way used to avoid name conflicts by separating the files into groups. used to control access to classes You can use as many packages as needed in a program the package name will appear at the top of program import package.className; // imports 1 class from pkg import package.*; //imports all classes from package IDE: classes should be saved in pkg folder Package names should be unique for distribution

Back

superclass

Front

A class that is extended by a subclass. It's variables and methods become available to the subclasses below it on the hierarchy - they are inherited. constructors not inherited by subclasses (not member methods)

Back

inheritance

Front

*allows one class to use functionality defined in another class * allows maximum re-use of existing code, which is written and tested, saving time * use the extends keyword to inherit from another class all non-private variables inherited * you cannot extend a final class

Back

void

Front

a keyword that indicates no value is to be returned a method does not return a result

Back

information hiding

Front

A server's ability to hide internal details from a client. The server is a black box.

Back

Method overriding

Front

Writing a method in a subclass that will be used instead of the method in the superclass. Subclass contains an identical method as found in superclass, but has unique code to be executed. Needs same return type, and arguments Needs scope to be access identical or less restrictive than parent, ie. public must be public CANNOT override final methods or static methods or constructors

Back

constants

Front

* values that will not change throughout program execution * Typed in all caps for readability and maintainability

Back

containment hierarchy

Front

a tree of components that has a top-level container as it's root Each top-level container has a content pane that contains visible components GUI components can be contained only once

Back

BOOLEAN data type

Front

only evaluate to TRUE or FALSE represented internally as....

Back

4 unordered collections

Front

Collection, set, bag, map

Back

subclass

Front

A class that will inherit the functionality of a superclass - and all superclasses in an inheritance tree via extends keyword: "class A extends class B". May access public and protected variables and methods Do not inherit superclass constructor Superclass constructor is called when subclass instantiated Can access superclass via super keyword A class has only one superclass

Back

variable

Front

Stores a value of a specific data type variable declaration: naming the variable

Back

INT data type

Front

*represents an integer (non-decimal) value of approximately -2.1 billion to +2.1 billion *represented internally as two bytes *may be specified as unsigned int: 0 to 4.2 billion does nor need quotes to be printed to screen

Back

Section 2

(50 cards)

Control: do while loops

Front

Runs code segment then evaluates if segment is to be run again after first loop Executed at least once

Back

String

Front

A linear collection Combines multiple characters into one object Immutable - recognize no mutator messages

Back

ArrayList<>

Front

A pre-defined Java object to store a list of data of a specific type of Object (not primitive type) Like an array, but will change size automatically. Created with an initial size, but that can change. Both capacity and data type may be specified Syntax: ArrayList<variable type> ie Integer, String ArrayList<Integer> myList = new Arraylist<Integer>(); Good for storing and accessing data

Back

Control: for loops

Front

Loop a pre-determined number of times until a condition is met. Consists of initialization, test condition, increment for(int i = 0; i <10; i++)

Back

array length

Front

myArray.length() will return the number of elements

Back

rand()

Front

returns a random number, as seeded by the clock

Back

Queue

Front

* A linear collection * Data-item insertions are made at one end (the queue's rear) and data-item retrievals/deletions are made at the other end *FIFO * insert = storing a data item in a queue * isEmpty = determining if a queue is empty * isFull = determining if a queue is full *remove = retrieving/deleting a data item from a queue

Back

Array

Front

Back

Concatenation

Front

joining several strings together with the + operator

Back

default statement

Front

in a switch statement optional located at end of switch, after last case default action if none of the cases are matched no break needed

Back

array literal

Front

shortcut for instantiating arrays of primitive types and Strings using a comma-separated list String[] names = {"sue", 'bill", "bob"};

Back

SortedCollection

Front

A linear collection Items are sorted according to some criteria

Back

Control: for each lopps

Front

A concise version of a for loop

Back

Advantages of encapsulation

Front

Allows control of the way data is accessed More flexible, easily modified code Ability to change one part of code without affecting other parts

Back

new

Front

keyword that creates an object using this keyword calls the constructor of a class

Back

null

Front

the absence of a reference

Back

Stack

Front

*A linear collection * Data-item insertions and retrievals/deletions are made at one end, which is known as the top of the stack * LIFO * Push() - insert on top of stack * Pop() = remove from top of stack * empty() = determines of stack is empty * peek() = peeks at top of stack without deleting anything

Back

this

Front

keyword that references the current object itself ie. it is this particular object that should be told when an event happens

Back

Control: if/else statements

Front

for a block of code to be executed conditionally evaluates of a statement is true, executes if true executes "else" if false ternary statements perform this same funtion

Back

break

Front

exits a switch statement if no break appears, flow will fall through to subsequent cases until a break is reached in loops, terminates the loop execution transferred to next statement that follows

Back

instantiation

Front

Sets up the data space, via the constructor, using the "new" keyword

Back

public scope

Front

methods and variables are accessible from outside the class

Back

varaiable declaration

Front

naming the variable so compiler may identify errors must start with a letter may contain letters, digits or underscores may be any length case sensitive cannot be a keyword

Back

mutator

Front

methods that modify the data of an object

Back

Control: while loops

Front

repeats code segment as long as conditional statement remains true Conditional statement evaluated before first loop May never be executed Use if you don't know how many iterations to expect

Back

static

Front

methods and variables that belong to the class as a whole, not any one object One variable is shared by all objects of a class Good practice to use all caps for naming static variables

Back

List

Front

A linear collection Items can be accessed at any position also called vectors or sequences

Back

DOUBLE data type

Front

* afloat represented internally as eight bytes

Back

Control: if statements

Front

for a block of code to be executed conditionally evaluates of a statement is true, executes if true Skips if false

Back

protected scope

Front

methods and variables are accessible from their own class and any subclasses

Back

Array

Front

*A sequence of elements, where each element associates with an index. First index is 0 * Each element occupies the same number of bytes *All elements share the same type. * size of the array is determined at compile time * contiguous memory loctions * int[] myArray = new[10]; //declares an array of 5 ints

Back

Hashing

Front

Each value in a hash table is associated with a unique key. A key's informational content is used to determine a unique value called a hashcode

Back

method overloading

Front

creating more than one method difference is in the list of parameters passed useful when two or more methods have nearly identical purposes when called, parameters are matched

Back

Heap

Front

a collection in which the "largest" item is considered the "top". This item is usually the only item accessible. Size may be any attribute

Back

BitSet

Front

A linear collection Data restricted to 0s and 1s Support logical operations on strings of bits

Back

Control: if/else if/else statemets

Front

for a block of code to be executed conditionally evaluates of a statement is true, executes if true evaluates "else if" if false evaluates "else" if both preceding conditions false

Back

random()

Front

returns a number between 0.0 and 9.9999...

Back

Control: switch statements

Front

Will execute a code block based on if a block is equal to a specific value (case) Keeps code organized and less wordy switch(condition) { case 1: action; // compares with switch condition break; // exits the switch statement default; // executed if no case conditions satisfied }

Back

Instance variable

Front

a variable that belongs to an individual object private, not visible outside the class it is defined in exists as long as it is referenced

Back

go to

Front

bad programming practice to use this in Java

Back

Set

Front

A collection that cannot contain duplicate elememts Hashset: does not retain the order the elements are added LinkedHashSet: maintains a linked list of the set's elements in the order they were inserted

Back

private scope

Front

* Methods and variables are accessible only from within the class in which they are defined * Not inherited by subclasses

Back

continue

Front

causes the loop to skip to next iteration used to skip loop execution if a certain value is true

Back

Control: ternary statements

Front

a one-line if/else conditional statement comprising three parts (boolean statement) ? (exe. if true) : ( exe. if false)

Back

encapsulation

Front

Ensures implementation details not visible to users Variables in one glass are hidden from other classes via keyword private Only getter/setter methods provide access to variables

Back

accessor

Front

methods that return attributes of an object

Back

Hashmap<>

Front

contains a set of keys and a value for each key like a dictionary Syntax: HashMap<keys, values> import java.uti.* modifies AbstractMap to use a hash table

Back

instanceof

Front

tests to see which event occurred ie. was that event a button push? -> (event.getSource() instanceof Button)

Back

garbage collection

Front

when objects "die" the memory space used to store them is de-allocated to a pool of free memory Automatic - Java tracks which objects are referenced Objects are considered garbage once nolonger referenced

Back

StringBuffer

Front

A linear collection Holds a copy of a String (which is immutable) to allow for manipulation

Back

Section 3

(50 cards)

binary tree

Front

a tree in which each node has at most two children

Back

postorder transversal

Front

a tree traversal that visits the left child, visits the right child, and then the item of each node

Back

Tree

Front

A finite group of nodes, where one of those nodes serves as the root and remaining nodes organize below the root in a hierarchical fashion

Back

edge/branch

Front

the line that connects a parent with a child

Back

Self-referential class

Front

a class with at least one field whose reference type is the class name, i.e. this class creates an instance of itself: class Employee { private double salary; public Employee next; }

Back

node

Front

an object you create from a self-referential class. class Employee { private double salary; public Employee next; }

Back

Doubly linked list

Front

A linked list of nodes, where each node has a pair of link fields. One link field lets you traverse the list in a forward direction, whereas the other lets you traverse the list in a backward directiondata-item insertions and retrievals/deletions are made at one end, which is known as the top of the stack

Back

boolean methods

Front

return true or return false

Back

Data Structure

Front

A collection of data elements whose logical organization reflects a relationship among the elements

Back

Jagged/ragged arrays

Front

2D arrays of irregular pattern

Back

event

Front

any user action

Back

parent node

Front

Predecessor - a node with at least one child A node has only one parent A parent may have more than one child (siblings)

Back

nested class

Front

*a class defined within another class, a.k.a an inner class - NOT A SUBCLASS - doess not inherit * is a proper class with constructor, member variables and methods, may be static, final, abstract *can access the private methods/variables of the outer class, this is what makes this construct useful

Back

Circular Queue

Front

Back

Priority queue

Front

a linear collection items are ordered according to priority

Back

Linear Queue

Front

front - rear -

Back

adapter class

Front

allows you to implement an interface and derive a subclass and use only methods of interest

Back

2D array

Front

2D array of a regular pattern an array of arrays int[][] myArray = { {1,2,3} {4, 5, 6} };

Back

formal parameters

Front

list of name/types in the method header

Back

initializing values

Front

assigning a value to a variable holds this value until explicitly changed int age =41; float score = 5.9f; char yes = 'Y'; boolean oldEnough = true;

Back

pass-by-reference

Front

when objects are passed as a parameter, a POINTER to the original object is passed (not a copy) ie. j.setAge(20) is a reference type, alters the value changes to the object by the receiving method will affect the original object Strings, arrays

Back

4 types of nested classes

Front

1. static nested class - can be used without instantiating the outer class 2. non-static nested class - belongs to an instance of the outer class 3. local inner class 4. anonymous local inner class

Back

casting

Front

changing one type to another in order to process data converting a float to an int requires casting double a = 5.23; int b = (int) a; //b is truncated to 5 not necessary to convert an int to a float - thats supported automatically by java

Back

algorithm

Front

a sequence of instructions that accomplishes a task in a finite time period.

Back

outer class

Front

* ecapsulates an inner (nested) class * cannot be declared private

Back

interface

Front

a completely abstract class that contains only abstract methods. Not instantiated! No code - only headers (no brackets) defined with interface keyword -no need for abstract keyword, that is implicit may contain only static final variables no constructor (cannot be instantiated) may extend other interfaces a class may extend many interfaces When implemented, need to @Override all the interface's methods

Back

primitive types

Front

single, nondecomposable data items byte, char, short, int, long, float, double, and boolean begin with lower case letter

Back

pass-by-value

Front

all primitive data types in Java are pass-by-value only a COPY of a variable is passed to a method changes to the copy do not affect the original

Back

Node

Front

an item stored in a tree

Back

return type

Front

ie private int calcAverage() specifies in method header what kind of return type the method will supply will be void if no value is to be returned

Back

depth/level

Front

the length of the path connecting a node to it's root

Back

method header

Front

one line specifying method before body i.e. private void calcAverage(){ ...method body...}

Back

leaf nodes

Front

nodes without children

Back

Singly linked List

Front

restrict node-traversal to a single direction: you can't traverse a singly linked list in the opposite direction

Back

enumeration

Front

A special type used to define collections of constants Declares variables of a fixed set comma-separated lists: enum Rank {SOLDIER, SERGEANT, CAPTAIN}; Should be used when a parameter/variable can only be one out of a small set of values

Back

AWT

Front

Abstract Window Toolkit A collection of GUI components - heavyweight The older GUI set, offers less control over asthetics

Back

local variables

Front

instance variables created when that method invoked exist only in that method, then cleared by gar Collection identical names may be used elsewhere

Back

child node

Front

Sucessor - a node that has a parent A node may have siblings, organized L to R as first child to last child

Back

link

Front

the reference in a link field "next's" reference to an Employee node is a link class Employee { private double salary; public Employee next; }

Back

Linked List

Front

A sequence of nodes that interconnect via the links in their link fields Involves the self-referential class, node, link field, and link. Initial capacity cannot be specified Good choice when you need to manipulate the list with a large amount of inserts and/or deletes

Back

actual parameters

Front

list that must be supplied when a method invoked specific parameters passed to an object

Back

link field

Front

field whose reference type is the class name "next" is the link field below class Employee { private double salary; public Employee next; }

Back

import statement

Front

first lines of code: import <> imports library files into code so we can call their methods - gives our classes access to the classes in the package being imported

Back

adjacent

Front

the property of being connected by an edge

Back

event handling

Front

arranging for the correct action to occur program must register as a listener for that event

Back

height

Front

the length of a tree's longest path

Back

anonymous inner class

Front

an inner class not assigned a name the compiler will assign a name add(newObject()) creates this anonymous instance must always extend a superclass constructed using the no-arg constructor

Back

preorder transversal

Front

a tree traversal that the item of each node, then visits the left child, then visits the right child

Back

truncation

Front

when a division of integers occurs, the fractional portion will be discarded so 5 / 2 = 2 Java does not round

Back

Iterator

Front

* An operation that allows us to process all the components in a data structure sequentially. An object attached to a collection ( called the backing collection). Replaced enumerator. Three methods: hasNext(), next() and remove().

Back

Section 4

(50 cards)

Choice

Front

* AWT Component * used to provide a choice to be selected from displayed list ItemListener will read the choice

Back

registered listener object

Front

*an object that will be messaged when an event occurs * 1. source registers it's listeners via addActionListener(this) (as an example) * 2. registered via implementing an interface, then all abstract handler methods must be added to code * may be empty or contain event-handling code 3. need to maintain a list of listener objects in the code and define addActionListener(Event evt) later in the code * the listener object will invoke it's event-handling method

Back

Source object

Front

the object that interacts with the user and gets triggered ie, Button clicked creates an event object to be registered to the registered listener objects source must first register it's listeners

Back

TextField

Front

AWT Component single-line text box that allows user enter text event fires when <enter> is pressed getText(), setText(), setEditable()

Back

Event handling

Front

*Triggering a source fires an event to all its listeners, and invoke an appropriate handler of the listener(s) *Listeners must be registered with the source ie. the listener "subscribes" to the source *subcribe-publish pattern aka observable-observe pattern

Back

AWT custom Graphics classes

Front

* ie. Color, Graphics and Font

Back

AWT GUI container class

Front

* one of the two types of GUI elements * are superclasses used to hold 1. components 2 sub-containers in a specific layout. * Needed for all GUI programs to set up window * Frame, Panel, Dialog, Scrollpane and Applet are examples

Back

ItemListener

Front

Reads the selection asserted from GUI component

Back

AWT List

Front

AWT Component used to provide a choice to be selected from drop-down list event fires when...

Back

AWT GUI component class

Front

* one of the two types of GUI elements * elementary GUI entities * ie. Button, Label and TextField * also known as controls or widgets

Back

Panel

Front

AWT Secondary Container class a rectangular area used to group components in a certain layout. Can add more than one layout to the Frame

Back

Label

Front

AWT Component display text to provide description getText(), setText(), setAlignment(), getAlignment()

Back

@Override

Front

An annotation - a class to help spot errors when inheriting classes will check to see if that class exists in the superclass

Back

full-stack development

Front

Back

AWT Layout managers

Front

* classes that allow control of component layout * ie FlowLayout, BorderLayout, GridLayout

Back

WindowEvent

Front

* Window (e.g., Frame) is closed, minimized public void windowClosing(WindowEvent e) { } public void windowOpened(WindowEvent e) { } public void windowCloseded(WindowEvent e) { } public void windowActivateded(WindowEvent e) { } public void windowDeactivateded(WindowEvent e) { } public void windowIconifiedd(WindowEvent e) { } public void windowDeiconifieded(WindowEvent e) { }

Back

MouseListener

Front

* Interface for GUI - implements MouseListener * for MouseEvents when mouse pressed,released or clicked * also enter or exit the (x, y) coordinates of an object * addMouseListener(this) registers object as a listener * 5 abstract methods needed in code even if not called

Back

Button

Front

AWT Component used to trigger certain programmed actions event firs when Button is clicked with mouse getLabel(), setLabel(), setEnable()

Back

MouseMotionListener

Front

* Interface for GUI - implements MouseMotionListener * for MouseEvents when mouse moved or dragged * addMouseMotionListener(this) registers as listener * 2 abstract methods needed in code even if not called

Back

MouseEvent

Front

* mouse is pressed, released, clicked (press then release) public void mousePressed(MouseEvent e) { } public void mouseReleased(MouseEvent e) { } public void mouseClicked(MouseEvent e) { } public void mouseEntered(MouseEvent e) { } public void mouseExited(MouseEvent e) { }

Back

MouseMotionEvent

Front

*called when mouse is moved or dragged public void mouseMoved(MouseEvent e) { } public void mouseDragged(MouseEvent e) { }

Back

KeyListener

Front

Interface for GUI - implements KeyListener * for KeyEvents a keyboard key is pressed, released or typed (press followed by release) * addKeyListener(this) registers object as a listener * 3 abstract methods needed in code even if not called

Back

addActionListener(this);

Front

* designates that object as an event listener * when an event fires, public void actionPerformed(ActionEvent evt) { } method is called * if more than one, if/else statement needed to determine correct action

Back

static final

Front

used to declare constants used throughout a program

Back

ItemEvent

Front

Back

parse

Front

divide into individual components

Back

final (variable)

Front

variable cannot be changed

Back

FlowLayout

Front

Frame superclass Displays GUI components left to right, top to bottom, depending on the window dimensions

Back

BorderLayout

Front

container is divided into 5 zones: EAST, WEST, SOUTH, NORTH and CENTER not all need to be used 2 constructors: public BorderLayout(int hgap, int vgap); public BorderLayout(); default: hgap = 0, vgap = 0

Back

Key Event

Front

* key press, release, type public void keyPressed(KeyEvent e) { } public void keyReleased(KeyEvent e) { } public void keyTyped(KeyEvent e) { }

Back

Three objects involved in event handling

Front

Source, Listener and Event Object

Back

String Tokenizer

Front

a character that is used to break up a string into substrings by looking for special characters that are used as breaks

Back

ActionListener

Front

* Interface for GUI objects - implements ActionListener * .addActionListener(this) registers an object as a listener * only one handling method in this interface

Back

Frame

Front

*AWT Container class (that acts as a superclass) * provides the "main window" for GUI application *import java.awt.Frame; allows us to inherit the main window (if our class extends Frame)

Back

setTitle("title");

Front

Frame superclass Sets the title displayed in the window frame

Back

setLayout(layout)

Front

FlowLayout or GridLayout inherited from Frame container class

Back

Top-Level container class

Front

the basic canvasses for GUI applications commonly Frame, Applet or Dialog

Back

event object

Front

Object created by source object, encapsulating all the necessary information about the activation

Back

CheckBoxGroup

Front

AWT Component used to provide a choice to be checked event fires when ...

Back

GridLayout

Front

Container is divided into a grid matrix of rows and columns 2 constructors: public GridLayout(int rows, int cols, int hgap, int vgap); public GridLayout(int rows, int cols); default: rows = 1, cols = 0, hgap = 0, vgap = 0

Back

implements

Front

tells the program it will be using an interface, a list of methods that the class must define

Back

TextArea

Front

AWT Component multiple-line text box that allows user enter text event fires when <enter> is pressed getText(), setText(), setEditable()

Back

ScrollPane

Front

AWT Secondary Container class provides horizontal or vertical scrolling does not inherit from Frame, Dialog or Applet

Back

final (method)

Front

method cannot be overriden by a a subclass protects the method against inadvertant change

Back

BoxLayout

Front

arranges components onto a single row or column

Back

WindowListener

Front

* Interface for GUI - implements WindowListener * object.addWindowListener(this); needed in code * Window handling methods such as minimize, close * 7 abstract methods needed in code even if not called

Back

literal

Front

a value hard-coded into the program (ie x=12.34)

Back

ActionEvent

Front

* a GUI component fires an event public void actionPerformed(ActionEvent e) { } public void windowOpened(WindowEvent e) { } return's button's label

Back

Secondary container class

Front

are placed inside a top-level container commonly Panel or Scrollpane

Back

CheckBox

Front

AWT Component used to provide a choice to be checked event fires when ...

Back

Section 5

(50 cards)

try-catch statement

Front

Back

JAbstractButton

Front

Back

paint

Front

Back

JVM

Front

Java Virtual Machine Execution environment for Java applications, which provides the layer of abstraction that allows code to run on any machine. Translates the .java source file into java bytecode, then places the bytecode into a .class file machine code). The .class file can then be executed by any JVM, which allows distribution. Any device with JVM installed can run a .class file Operating system dependent: translates bytecode into different machine languages for different operating systems Allocates memory used by the program

Back

double buffering

Front

Back

JTextArea

Front

Back

JList

Front

A drop-down list of items Needs to be added to JScrollPane for scrolling capabilities

Back

JDB

Front

Java Debugging tool

Back

Font

Front

Back

JComponent

Front

*sub-class of Container * super to most swing components, class consists of a large number of methods inherited by all swing components

Back

JToggleButton

Front

Back

JPopUpMenu

Front

Back

JApplet

Front

Top-Level container Used or Applet's display-area inside a browser window

Back

IllegalArguementException

Front

Back

Integer.parseInt(int);

Front

casts an integer as a String for use when the value is to be displayed ie. GUI

Back

JTextField

Front

Back

FileWriter

Front

Back

setDefaultCloseOperation()

Front

method provided by JFrame to close down window rather than use a window handler

Back

JPanel

Front

Secondary container add the content pane here

Back

setSize(500, 400)

Front

Frame superclass Sets the size of the window as (width, height)

Back

Exception

Front

an error that will be handled according to the type of error encountered

Back

Swing Top-level Containers

Front

JFrame, JWindow, JApplet and JDialog Are heavyweight (special case) Do not inherit JComponent Cannot be contained within any other component

Back

JFrame

Front

Top-Level container Used for application's main window

Back

JRE

Front

Java Runtime Environment Includes the JVM

Back

setVisible(true)

Front

Frame superclass makes the window visible if not set to true, all the components in the program are invalid

Back

JTable

Front

Back

JDK

Front

Java Development Kit Includes jar, javac and jdb

Back

Java Swing

Front

GUI Library of components that begin with "J" package javax.swing Newer library - lightweight - use less system resources support pluggable look-and-feel - looks the same regardless of operating system support mouse-less operation Uses AWT event classes and added additional classes Uses AWT layout managers Do not require elements to be opaque and rectangular

Back

JScrollPane

Front

Back

Rectangle

Front

Back

Tool Tips

Front

Back

PrintWriter

Front

Back

key bindings

Front

Back

JAR Archive

Front

Java Archive

Back

menu bar

Front

Added to the JFrame, anolg with the content Pane

Back

Color

Front

Back

Dimension

Front

Back

AWT Applet

Front

a java program running in a browser import java.awt.applet;

Back

JButton

Front

Back

Swing Lightweight Containers

Front

* JPanel, JRootPane * Lightweight, do inherit from JComponent. * May be contained within another container. * Used to organize and manage related GUI components

Back

Javabeans

Front

a component-based model used in visual programming Can drag-and-drop into a design form using a GUI

Back

Border

Front

Back

TransferHandler

Front

Supports exchanging data via cut, copy and paste to/from a clipboard. Also drag-and-drop

Back

Content-pane

Front

Swing components added to content-pane, not the top-level container directly. getContentPane() gets pane of the JFrame or JPAnel

Back

Cursor

Front

Back

javac

Front

the command to run the java compiler will compile a source file with a .java extension into a .class file. This is bytecode for a JVM

Back

AWT Dialog

Front

a pop-up dialog box has title bar and content area

Back

JDialog

Front

Top-Level container Used for secondary pop-up window

Back

JLabel

Front

Back

Point

Front

Back

Section 6

(50 cards)

API

Front

Application Program Interface A collection of classes written to use Need to be imported into code

Back

downcasting

Front

casting an instance of a superclass to a subclass Animal a = new Animal(); ((Cat)a).makeSound(); // cat is subclass, Manual - this process might fail if incompatible

Back

exception handling

Front

handles runtime errors to maintain normal program flow good programming practice try and catch keywords

Back

quicksort

Front

a fast sorting technique rearranges elements around a pivot element and recursively sorts these elements

Back

final class

Front

cannot be implemented a a subclass

Back

POJO

Front

Plain Old Java Object

Back

postfix increment

Front

variable is first used, then incremented x++ equals x = x +1 i.e. int x = 78; int y = x++; //y is 78 and then x becomes 79

Back

anonymous classes

Front

a way to extend existing classes on the fly @Override annotation makes this overriding obvious only available to current object, not class will not affect other object with that class

Back

EJB

Front

Enterprise JavaBeans

Back

java

Front

the command to run an executable java file this will have a .class extension

Back

upcasting

Front

casting an instance of a subclass to it's superclass Animal a = new Cat(); // cat is subclass Automatic- this process will never fail

Back

System.out.println;

Front

Outputs text and a newline to the console

Back

cohesive method

Front

a method designed to accomplish a single task

Back

UI Delegate

Front

a modified form of MVC (Model View Controller) .

Back

StringBuilder class

Front

Allows you to append text to a String via the .append() method String are immutable so if you append to a String you are actually creating a new String object which is inefficient output with the toString() method

Back

operand

Front

the value each side of an operator

Back

equals()

Front

== compares references, not original objects equals() is predefined method that compares the attributes of two objects needs a hashCode

Back

pivot

Front

a data item around which an array element is subdivided using a quicksort

Back

modulo

Front

performs an integer division of two variables, then returns the remainder only. The quotient is discarded.

Back

.class

Front

the bytecode file

Back

parsing

Front

The process of anayizing an expression for syntactic correctness

Back

Assignment Operators

Front

+=, -=,*=, /=, %= shorthand notation for easier code ie. num2 += num1; // num2 = num1 + num2

Back

prefix increment

Front

variable is first incremented, then used ++x means that the expression x = x +1 evaluates first i.e. int x = 34; int y = ++x; //y is 35

Back

port

Front

A channel through which several clients can exchange data with the same server, or with different servers

Back

Object class

Front

Parent class to all objects, contains the following classes: .toString(); - returns className@hashcode. This may ne overwritten to return anything you like .equals() - returns

Back

MVC

Front

Model View Controller Model: the state of the information associated with the component View: how the component is displayed on the screen Controller: How the component reacts to the user

Back

JFC

Front

Java Foundation Classes

Back

hash table

Front

a data structure that allows the programmer to access items by identifying key values and supports very fast lookups

Back

exception

Front

a problem that occurs during program execution May cause abnormal termination Causes: user error, programmer error, physical resource issues

Back

final variable

Front

The final keywords marks a constant whose value cannot be changed. Names are written in all caps.

Back

catch block

Front

the code executed if an exception occurs in the try block

Back

GridLayout()

Front

Creates a grid layout with a default of one column per component, in a single row. GridLayout() GridLayout(3,4) creates a layout of rows, columns

Back

DI

Front

Dependency Interjection

Back

AOP

Front

Aspect-Oriented Programming

Back

Scanner Object

Front

Reads user input from the console import java,util.Scanner; Scanner myInput = new Scanner(System.in); use the method appropriate to the data type to be entered, ie, nextInt(), nextFloat

Back

recursion

Front

the process of a subprogram calling itself A stopping state must exist

Back

fail-fast

Front

an approach to error conditions in which exceptions are thrown as soon as errors are encountered

Back

inner classes

Front

a class may be a member of another class inner class might be private inner classss can access all variables and methods of outer class inner class cannot be accessed by any outside class

Back

StringBuffer class

Front

Back

Spring

Front

A Framework

Back

socket

Front

an object that serves as a communication link between a single server process and a single client process

Back

substring()

Front

substring(int beginIndex, int endIndex) produces a String fragment

Back

IDE

Front

Integrated Development Environment Netbeans, Eclipse

Back

hashing

Front

the method of determining the location of a given item in a hash table

Back

try-catch statement

Front

a block of code that surrounds an operation that might cause a runtime error try the code in the try block -

Back

final method

Front

cannot be overriden by a method in by a subclass

Back

toString()

Front

native method of the Object class produces a String representation of the object this will be: className@hashcode if no overrriding toString() method written in the class

Back

throws

Front

keyword that allows you to manually generate exceptions from your methods

Back

try block

Front

the code that tests for an exception. if yes, the catch block is executed

Back

Math class

Front

Pre-defined static math operations No object needed, just Math.op() Math.abs(x);//returns absolute value of x Math.ceil(x, y); //rounds a float up to the nearest integer Math.floor(x, y);//rounds down Math.pow(x, y); // returns x raised to the exponent y

Back

Section 7

(9 cards)

%f

Front

Float format specifier 0.2f - formats two decimal places (default is 6) %-6.1fn - One decimal place, left-aligned in 6-character field

Back

String.substring(int, int)

Front

returns a String fragment specified by the beginning and ending indexes

Back

System.out.printf;

Front

Outputs formatted text to the console

Back

%d

Front

Integer format specifier %-10d: integer in a space ten characters wide, padding with space and left-align %10d: right-align in a space padded ten characters wide

Back

%c

Front

Character format specifier

Back

int i = Integer.parseInt();

Front

converts a String to an int

Back

%s

Front

String format specifier

Back

<?>

Front

wildcard, class of unknown type Must refer to object as Object or downcast the object as a type

Back

toString()

Front

Back