Platform Flashcards
JDK vs JRE vs JVM
JVM = Java Virtual Machine. It is a specification for how java bytecode should be executed. Implementations are platform specific.
JRE = Java Runtime Environment. The current implementation of the JVM.
JDK = Java Development Kit. It physically exists. It contains JRE + development tools.
What is the JIT Compiler?
The Just-In-Time compiler is part of the JRE. The JIT analyzes interpreted code and determines which code should remain as bytecode and which code should be compiled to machine code. One method is to maintain a counter on methods.
What is a classloader?
Object responsible for finding and loading classes at runtime. Each instance has an associated parent. Every Class object contains a reference to the ClassLoader that defined it.
What allows Java to “write once and run anywhere”?
Java bytecode is an intermediate language between source code and machine code. The bytecode is not platform specific.
Do local variables have defaults? What about primitives?
Local variables do NOT have defaults. Primitives do not have defaults as well.