0
0
Javaprogramming~20 mins

JDK, JRE, and JVM difference in Java - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Java Platform Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
What is the primary role of JVM?
Which of the following best describes the main function of the JVM (Java Virtual Machine)?
AIt manages Java source code files.
BIt executes Java bytecode on any platform.
CIt provides tools to develop Java applications.
DIt compiles Java source code into bytecode.
Attempts:
2 left
💡 Hint
Think about what runs the Java program after compilation.
🧠 Conceptual
intermediate
2:00remaining
Which component includes the Java compiler?
Among JDK, JRE, and JVM, which one contains the Java compiler (javac)?
AJVM only
BJRE only
CBoth JRE and JVM
DJDK only
Attempts:
2 left
💡 Hint
The compiler turns source code into bytecode.
Predict Output
advanced
2:00remaining
Output of JVM version command
What will be the output type when running the command `java -version` in a terminal?
Java
java -version
ADisplays the installed JVM version information.
BCompiles the Java source code.
CRuns the Java program without showing version.
DShows an error because 'java -version' is invalid.
Attempts:
2 left
💡 Hint
This command is used to check Java installation details.
Predict Output
advanced
2:00remaining
What happens if you run a Java program with only JRE installed?
If you have only JRE installed on your computer, what will happen when you try to compile and run a Java program?
AYou can compile and run the program successfully.
BYou can compile the program but cannot run it.
CYou can run the program but cannot compile it.
DYou cannot compile or run the program.
Attempts:
2 left
💡 Hint
JRE is for running Java programs, not compiling them.
🧠 Conceptual
expert
3:00remaining
How do JDK, JRE, and JVM relate in Java execution?
Which statement correctly describes the relationship between JDK, JRE, and JVM during Java program development and execution?
AJDK contains JRE, which contains JVM; JVM runs the bytecode, JRE provides runtime environment, and JDK provides development tools.
BJDK, JRE, and JVM are independent and do not contain each other; all are needed separately to run Java.
CJVM contains JDK, which contains JRE; JDK runs bytecode, JVM compiles source code, and JRE is for debugging.
DJRE contains JDK, which contains JVM; JVM compiles source code, JRE runs bytecode, and JDK is optional.
Attempts:
2 left
💡 Hint
Think about the hierarchy and roles of each component.