A comprehensive overview of fundamental computer science terms and Java programming concepts. External links, mostly to Wikipedia, are provided in case of special interest in a particular topic.
Procedural-Based: This is also known as imperative programming. There is no polymorphism or even code reuse.
Object Based: Has some code reuse, but no explicit polymorphism.
Object Oriented: Incorporating polymorphism, it encapsulates data, meaning data is hidden and adaptable.
Prototype-based: Has polymorphism, but has no classes - rather, it clones objects as encapsulated entities without class blueprints.
Polymorphism: The ability to create a variable, a function, or an object that has more than one form.
Encapsulation: Keeps data hidden and allows for adaptability through organization / code reuse.
Inheritance: Creates a derived subclass as an extension of a superclass. (An “is a” relationship)
Composition: Creates an object of another class to use. (A “has a” relationship.)
Class: The blueprint for an object to be instantiated from containing attributes, data structures, and methods.
Object (or Instance): An encapsulated entity based on a class blueprint.
Instantiate: To create a new instance of an object, i.e. to realize it.
Upcasting: Permits an object of a subclass type to be treated as an object of any superclass type.
Downcasting: Permits an object of a superclass type to be treated as an object of any subclass type.
Overriding: Providing a different implementation of a method in a subclass of the class that originally defined the method.
Abstract: Used in a class or method definition to specify that it is not to be instantiated, but rather inherited by other classes.
Abstract class: This is a base class that passes general shared methods with no implementation down to other classes.
Interface: An implicitly abstract type that classes must implement, used to define a contract for how classes interact with an object.
Refactoring: Altering a body of code's internal structure without changing its external behavior.
Inner (or Nested) Class: Class whose only application is within the scope of its parents class.
Enumerations: Identifiers that behave as constants in the language.
Design patterns are different templates that can be reused for similar kinds of problems.
Creational: Involved with the process of object creation.
Factory Method: Decouples the client system from the actual implementation classes through the abstract types and factories. The Factory Method creates objects through inheritance.
Abstract Factory: Decouples the client system from the actual implementation classes through the abstract types and factories. The Abstract Factory creates objects through composition.
Singleton: Restricts instantiation of a class to one object. This became popular for providing global access for some service, limiting creation of objects, and tightly coupling classes. However, global variables are inefficient and vague in their usage. Singleton also violates the Single Responsibility Rule; the class can use a factory to limit creation and maintain encapsulation. The restrictive nature of the singleton also makes testing extremely difficult, and because of its persistent state it may cause false positives in unit testing. The singleton can easily be replaced by more effective means.
Builder: Separates the construction of a complex object from its representation so that the same construction process can create different representations. The Builder pattern is the creation of objects step by step. The Factory Method pattern defines an interface and let the subclasses decide which object to instantiate.
Structural: Deals with the composition of classes or objects.
Adapter (Wrapper): Classes that wrap up primitive values in classes that offer utility methods to manipulate the values. Once assigned a value, the value of a wrapper class cannot be changed.
Facade: This is a style of design pattern which analyzes the system at face value ignoring all of the inner working and processes (a single interface to multiple underlying objects).
Session Facade: A higher-level business component that contains and centralizes complex interactions between lower-level business components decoupling lower-level business components from one another, making designs more flexible and comprehensible. This provides clients with a single interface for the functionality of an application.
Flyweight: Use sharing to support large numbers of fine-grained objects efficiently. Designing objects down to the lowest levels of system “granularity” provides optimal flexibility, but can be unacceptably expensive in terms of performance and memory usage.
Proxy: A system that acts as an intermediary for requests between clients and servers. Also a class functioning as an interface to something else.
Dynamic Proxies: A class that implements a list of interfaces specified at runtime such that a method invocation through one of the interfaces on an instance of the class will be encoded and dispatched to another object through a uniform interface.
Proxy Pattern: Software design pattern of the following types
Behavioral: Characterize the ways in which classes or objects interact and distribute responsibility.
Observer: Any object that wishes to be notified when the state of another object changes.
Observable: Any object whose state may be of interest, and in whom another object may register an interest.
Visitor: A way of separating an algorithm from an object structure on which it operates. A practical result of this separation is the ability to add new operations to existing object structures without modifying those structures.
Sort: Algorithm used to organize data.
Search: Algorithm used to find data.
Collection: The Java classes in the Collections Framework encapsulate both the data structures and the algorithms associated with these abstractions.
Generic: Add stability to your code by making more of your bugs detectable at compile time.
Hashing: Any algorithm or subroutine that maps large data sets, called keys, to smaller data sets.
Reference: A variable data type in which the variable's value is an address.
Primitive: A variable data type in which the variable's value is of the appropriate size and format for its type: a number, a character, or a boolean value.
Static: Determines how a thing can be accessed.
Main(): A method in the controlling class used to initialize the program
Method: A piece of a class, used to implement actual pieces of code
Method Signatures: Collection of information about the method including name, visibility, type(static or not), its arguments, and return type
Constructor: Initializes the already constructed (created) object, called right after memory is allocated for the object. Has no return (not even void) and has same name as the class.
Assign: To throw away the old value of a variable and replace it with a new one
Initialize: A special kind of assignment: the first. Before initialization objects have null value and primitive types have default values such as 0 or false. Can be done in conjunction with declaration.
Declare: A declaration states the type of a variable, along with its name. A variable can be declared only once. It is used by the compiler to help programmers avoid mistakes such as assigning string values to integer variables. Before reading or assigning a variable, that variable must have been declared.
Delete: removes an object, reference, primitive, etc. from the memory.
Free: same as “delete” without invocation of destructor, and cannot be overloaded.
New: creates a object, reference, primitive, etc., and adds it to the memory.
malloc: same as “new” without invocation of constructor, and needs specification of size, and doesn't throw failure.
Access Control Modifier: A keyword that determines the visibility of the class, as the following chart explains:
Class Package Subclass World
Public
Y
Y
Y
Y
Protected
Y
Y
Y
N
Package
Y
Y
N
N
Private
Y
N
N
N
Local Variable: A variable that is given local scope and is accessible only from the function or block in which it is declared.
Global Variables: Unlike local variables, these variables are accessible everywhere in the project. These are not good to use, because they can lead to shadowing and other confusion, as well as continuously allocating memory, which is just wasteful.
Fields: A data member of a class. Unless specified otherwise, a field is not static.
Method Overloading: Using one identifier to refer to multiple items in the same scope. In the Java programming language, you can overload methods, but not variables or operators.
this: A Java keyword that can be used to represent an instance of the class in which it appears; "this" can be used to access class variables and methods.
final: A Java keyword. You define an entity once and cannot change it or derive from it later. More specifically: a final class cannot be subclassed, a final method cannot be overridden and a final variable cannot change from its initialized value.
Packages: A group of types (class or interface), and are declared with the package keyword.
Libraries: A set of dynamically loadable libraries that Java applications can call at run time.
Classpath: An environmental variable which tells the Java virtual machine and Java technology-based applications where to find the class libraries, including user-defined class libraries.
Casting: Explicit conversion from one data type to another.
Argument: A data item specified in a method call. An argument can be a literal value, a variable, or an expression.
Block: A sequence of statements, local class declarations and local variable declaration statements within braces.
catch: A Java keyword used to declare a block of statements to be executed in the event that a Java exception, or run time error, occurs in a preceding try block.
try: A Java keyword that defines a block of statements that may throw a Java language exception. If an exception is thrown, an optional catch block can handle specific exceptions thrown within the try block. Also, an optional finally block will be executed regardless of whether an exception is thrown or not.
finally: A Java keyword that executes a block of statements regardless of whether a Java Exception, or run time error, occurred in a block defined previously by the try keyword.
Exception: The customary way in Java to indicate to a calling method that an abnormal condition has occurred. In Java exceptions are objects.
Exception Handler: A block of code that reacts to a specific type of exception. If the exception is for an error that the program can recover from, the program can resume executing after the exception handler has executed.
Exception Hierarchy: Only objects descending from the Throwable class may be thrown. Two direct descendants of this class are Exception and Error.
Global Exception Handling: Rather than sprinkling try/catch blocks throughout your applications they can all be managed at one location. The first step is to define your own UncaughtExceptionHandler implementation class. The second step is to set the default uncaught exception handler.
loop: Repeats a specified section in the code according to a state or predefined number set by the programmer.
if-else: An operation used to say if A happen then this happens, otherwise that happens.
for: A loop that has a set number of iterations set by the programmer.
while: A loop that continues to iterate over a section while a certain state or property exists.
do: A while loop based on a boolean condition.
switch: a certain kind of if statement that allows many choices to be chosen from rather than just two (if or else)
Equality: One way for primitives, four for objects
a==b, a!=b: Will only be true if two references point to the same underlying object.
equals(): Will return true if two objects have the same value.
compare(): For comparing values.
compareTo(): Compares values returning int less than, equal, or greater than.
Equivalence: When !(a