Running Java Programs Flashcards

1
Q

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

A

b) You only need to write one program, which can run on any platform

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

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

A

b) It serves as an intermediary between software and hardware

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

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

a) Write different programs for each platform

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

Who maintains the Java Virtual Machine (JVM)?

a) AMD Corporation
b) Intel Corporation
c) Oracle Corporation
d) Microsoft Corporation

A

c) Oracle Corporation

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

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

A

b) It allows them to focus on writing a single program without worrying about the underlying OS

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

What is the file extension for Java source code?

a) .class
b) .java
c) .exe
d) .byte

A

b) .java

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

Which component translates Java source code into bytecode?

a) Java Virtual Machine
b) Operating System
c) Java Compiler
d) Java Runtime Environment

A

c) Java Compiler

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

What is the file extension for Java bytecode?

a) .java
b) .exe
c) .class
d) .bin

A

c) .class

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

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

A

b) It is executed by the Java Virtual Machine (JVM)

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

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

A

b) Java Development Kit

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