JVM, JDK & JRE — Concept Check
Questions on JVM, JDK & JRE. Understand the three pillars of Java: JRE runs programs, JDK develops them, and the JVM executes bytecode on any platform.
Questions in this quiz
8 questions on JVM, JDK & JRE — Concept Check. Work through them here, then start the quiz to answer them and see your score.
1.A developer is trying to run a Java application but only has the JRE installed. What is likely to happen?
- AThe application will fail to compile.
- BThe application will fail to run due to missing JDK.
- CThe application will fail to run due to missing JVM.
- DThe application will run without issues.
2.You compiled a Java program using JDK on Windows. What must you do to run it on Linux?
- AInstall a Linux-specific JRE.
- BConvert the .class file to Linux bytecode.
- CRecompile the source code on Linux.
- DUse the same .class file on Linux.
3.A Java application is running slowly. Profiling shows high time in the interpreter. What might improve performance?
- AUsing a JIT compiler.
- BIncreasing JVM heap size.
- CRewriting code in C++.
- DSwitching to a faster CPU.
4.A developer uses `javac` to compile a Java program. What is the output?
- AA .jar archive file.
- BA .java source file.
- CA .class bytecode file.
- DAn executable file.
5.An application crashes with an 'OutOfMemoryError'. What area is likely exhausted?
- AHeap
- BJVM Stack
- CMethod Area
- DPC Register
6.A developer claims the JVM is responsible for compiling Java source code. What's incorrect here?
- AJVM executes bytecode, not source code.
- BJVM is part of JRE, not JDK.
- CJVM includes a debugger tool.
- DJVM compiles source code to bytecode.
7.What happens if you try to run a Java program without a JDK installed?
- AThe program will compile but not run.
- BThe program will run with limited features.
- CThe program will neither compile nor run.
- DThe program will run but not compile.
8.A developer wants to package a minimal runtime for a Java 9 application. What tool should they use?
- Ajlink
- Bjavac
- Cjavadoc
- Djava