Computer Knowledge
Programming Languages and Compilers
2,284 Questions
Programming languages and compilers involve the rules, syntax, and semantics used to write and execute software programs. Key areas include scripting languages, object oriented concepts, and parsing algorithms like top down parsers. Practice these computer science questions to build proficiency for technical and computer knowledge exams.
Object oriented languagesScripting languagesCompilers and parsersProgramming syntax
Programming Languages and Compilers Questions
-
subjective
-
objective
-
evil
-
object based
D
Correct answer
Explanation
JavaScript is an object-based language, meaning it uses objects as its fundamental building blocks but doesn't have classical inheritance. Unlike purely objective languages like C++, it uses prototype-based inheritance. It's not subjective or evil in any technical sense.
-
Precede it with two forward slashes, i.e. '//'
-
Precede it with an asterisk and a forward slash, i.e. '*/'
-
Precede it with an asterisk, i.e. '*'
-
Precede it with a forward slash and an asterisk, i.e. '/*'
A
Correct answer
Explanation
Single-line comments in JavaScript start with two forward slashes (//). Option B describes the end of a multi-line comment (/), option C is just multiplication, and option D is the start of a multi-line comment (/), which can span multiple lines but isn't used for single lines.
-
DO UNTIL
-
DO WHILE
-
ITERATE
-
Wrong question!
C
Correct answer
Explanation
ITERATE is a REXX command that skips the remaining instructions in the current DO loop iteration and immediately proceeds to the next iteration. DO UNTIL and DO WHILE are loop control structures that determine when the loop exits, not what skips within an iteration. Option D is clearly invalid.
-
Read the stack and have a counter value
-
Using STACK.0
-
Using STACK.MAX
-
Usinf MAX function
B
Correct answer
Explanation
In REXX, compound variables (stacks) use stem notation where STEM.0 automatically contains the element count. Reading and counting manually is inefficient, STACK.MAX doesn't exist, and MAX is for numeric comparisons.
-
using DEFINE
-
using DECLARE
-
Cant use alphanumeric variable in REXX
-
No need to define. REXX will deal them.
D
Correct answer
Explanation
REXX is typeless and dynamically typed - variables need no declaration and automatically handle alphanumeric values. DEFINE and DECLARE aren't REXX keywords for variable declaration.
-
ASP.NET applications run without a Web Server
-
ASP+ and ASP.NET refer to the same thing
-
ASP.NET is a major upgrade over ASP
-
None of the Above
A
Correct answer
Explanation
ASP.NET applications require a web server, such as IIS (Internet Information Services), to process requests and host the application, making the statement that they run without a web server false.
B
Correct answer
Explanation
Java eliminated C-style direct pointer manipulation and pointer arithmetic to improve memory safety and security, relying instead on managed object references and automatic garbage collection.
-
You couldn't type APL code using the characters on an ordinary typewriter keyboard
-
As a Mac OS-only language you couldn't program in APL without using a GUI editor
-
APL had no concept of strings; text had to be processed and output one character at a time
-
As the world's only Albanian Programming Language all APL's keywords were based on Albanian
A
Correct answer
Explanation
APL used a special character set with symbols that couldn't be typed on standard keyboards, requiring specialized input equipment. This made it impractical as keyboards standardized. Option B is wrong (APL predates Mac OS), C is wrong (APL handled strings), and D is a joke.
-
Java
-
C++
-
Python
-
All of the above
D
Correct answer
Explanation
Python uses line breaks instead of semicolons to terminate statements. Java and C++ require semicolons. Since Python doesn't require them, 'All of the above' is correct - not all languages need semicolons.
-
Functions can take other functions as arguments and return them as results
-
Algorithms are expressed in natural mathematical terms rather than as procedural steps
-
Every function must modify some kind of state - either within the machine or in the outside world
-
Recursion is encouraged
C
Correct answer
Explanation
Functional programming emphasizes pure functions with no side effects - they don't modify state (option C is false, thus 'NOT a characteristic'). Options A (higher-order functions), B (mathematical style), and D (recursion) are all true characteristics.
-
SQL
-
PostScript
-
AppleScript
-
Tcl
A
Correct answer
Explanation
SQL is a query language for databases, not a general-purpose programming language - it lacks features like loops, conditionals, and general computation. PostScript, AppleScript, and Tcl are all Turing-complete programming languages.
-
Subversion
-
Apache Ant
-
NetBeans
-
Spring
C
Correct answer
Explanation
NetBeans is a comprehensive IDE for Java development, similar to how Visual Studio serves C# developers. It provides code editing, debugging, and project management features. Subversion is version control, Apache Ant is a build tool, and Spring is a framework - none are full IDEs.
-
ActionScript
-
AppleScript
-
PostScript
-
VBScript
-
ActionScript
-
AppleScript
-
PostScript
-
VBScript
A
Correct answer
Explanation
ActionScript is a dialect of ECMAScript, the standardized scripting language specification. JavaScript is the most well-known ECMAScript implementation, but ActionScript (used in Adobe Flash) was also built on the ECMAScript standard. The other options are not ECMAScript dialects: AppleScript is Apple's native scripting language, PostScript is a page description language, and VBScript is Microsoft's Visual Basic scripting language.
D
Correct answer
Explanation
The DATA step uses _null_ which does not create a dataset. When proc print; runs, it attempts to print the most recently created dataset. Since no dataset was created, it results in an error.