SCRIPTING-AND-PROGRAMMING-FOUNDATIONS practice question 22 of 25

Which kind of languages are C, C++ and Java?

Full set: 137 questions
Answer options
A: Markup
B: Compiled Correct answer
C: Interpreted
D: Machine code
Correct Answer:
B. Compiled
Explanation

C, C++, and Java are all classified as compiled languages. In this model, the human-readable source code is processed by a compiler program before execution. The compiler translates the source code into a lower-level representation. For C and C++, this is typically native machine code specific to the target processor. For Java, the compiler generates platform-independent bytecode, which is then executed by the Java Virtual Machine (JVM). Despite the intermediate step for Java, the essential pre-execution translation by a compiler is the common, defining characteristic.

Why Incorrect

A. Markup languages like HTML are used for document structuring and presentation, not for creating the logic of an application.
C. Interpreted languages are processed line-by-line at runtime. C, C++, and Java all require a distinct, ahead-of-time compilation step.
D. Machine code is the result of compiling languages like C and C++; it is the target language, not the source language category.

References

1. Pratt, T. W., & Zelkowitz, M. V. (2001). Programming Languages: Design and Implementation (4th ed.). Prentice Hall. Chapter 2 discusses language translation, clearly distinguishing compiled languages (like C, C++) from interpreted ones.

2. Stroustrup, B. (2013). The C++ Programming Language (4th ed.). Addison-Wesley. The preface and early chapters describe C++ as a language designed for compilation to produce efficient, executable code.

3. Gosling, J., Joy, B., Steele, G., & Bracha, G. (2014). The Java Language Specification, Java SE 8 Edition. Oracle America, Inc. Chapter 1, Section 1.2, describes the compilation of Java code into the machine-independent bytecode format of the Java Virtual Machine.

Scroll to Top