Running Java Programs Flashcards
What does the Java Virtual Machine (JVM) ensure?
a) You need to write separate programs for each platform
b) You only need to write one program, which can run on any platform
c) The program only runs on Linux and Windows
d) The program is specific to Intel processors
b) You only need to write one program, which can run on any platform
What is the main function of the operating system in relation to hardware?
a) It ensures that the program runs on Intel processors only
b) It serves as an intermediary between software and hardware
c) It makes software dependent on specific hardware
d) It translates Java programs directly into machine code
b) It serves as an intermediary between software and hardware
What would Java programmers need to do if there was no JVM?
a) Write different programs for each platform
b) Write assembly code for different processors
c) Only write programs for macOS
d) Rely on Oracle Corporation to execute their programs
a) Write different programs for each platform
Who maintains the Java Virtual Machine (JVM)?
a) AMD Corporation
b) Intel Corporation
c) Oracle Corporation
d) Microsoft Corporation
c) Oracle Corporation
How does the JVM help Java programmers?
a) It directly translates Java code into hardware instructions
b) It allows them to focus on writing a single program without worrying about the underlying OS
c) It only works on Linux systems
d) It removes the need for an operating system
b) It allows them to focus on writing a single program without worrying about the underlying OS
What is the file extension for Java source code?
a) .class
b) .java
c) .exe
d) .byte
b) .java
Which component translates Java source code into bytecode?
a) Java Virtual Machine
b) Operating System
c) Java Compiler
d) Java Runtime Environment
c) Java Compiler
What is the file extension for Java bytecode?
a) .java
b) .exe
c) .class
d) .bin
c) .class
Which of the following is true about Java Bytecode?
a) It is directly executed by the operating system
b) It is executed by the Java Virtual Machine (JVM)
c) It is written by the Java developer
d) It can run without the JVM
b) It is executed by the Java Virtual Machine (JVM)
What is required to translate source code into bytecode in Java?
a) Java Runtime Environment
b) Java Development Kit
c) Java Bytecode Editor
d) Java Virtual Machine
b) Java Development Kit