Platform Flashcards

1
Q

JDK vs JRE vs JVM

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the JIT Compiler?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is a classloader?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What allows Java to “write once and run anywhere”?

A

Java bytecode is an intermediate language between source code and machine code. The bytecode is not platform specific.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Do local variables have defaults? What about primitives?

A

Local variables do NOT have defaults. Primitives do not have defaults as well.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly