Dynamic Loading and Linking

With dynamic loading, the operating system loads a function's code into memory from disk only when it is called. The advantage is that memory isn't filled up with functions that aren't used, which makes the program start faster.

Static linking is when library modules get fully included in executable files, wasting both disk space and main memory usage, because every program that included a certain function from the library would have to have their own copy of that function linked into their executable code.

Dynamic linking happens when only a stub is linked into the executable module, containing references to the actual library module linked in at run time, which saves disk space. Java uses dynamic linking.

With such dynamically linked libraries (DLL), program maintenance is more convenient since, each time a change in the functions of the library (or class or interface) is made, there is no necessity in re-compiling a program that uses the library as long as the stub didn't change.