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
-
HTML
-
Events
-
Array
-
ArrayList
B
Correct answer
Explanation
Events are actions or occurrences that JavaScript can detect and respond to, such as clicks, key presses, mouse movements, and page loads. The browser triggers event handlers when these actions occur.
-
overMouse event
-
onMouseOver event
-
onRollOver event
-
OnMouseOut event
B
Correct answer
Explanation
The onMouseOver event fires when the mouse pointer moves over an element. For links specifically, this event can be used to trigger actions like changing link appearance, showing tooltips, or prefetching content. JavaScript uses camelCase naming for events.
-
stringVariable.substring(subString)
-
stringVariable.find(subString)
-
stringVariable.indexOf(subString)
-
stringVariable.indexOf(charAt(0))
C
Correct answer
Explanation
The indexOf() method searches for a substring within a string and returns the index of the first occurrence, or -1 if not found. The syntax is string.indexOf(substring). Options A and B use incorrect method names (substring, find), and option D incorrectly nests charAt(0) inside indexOf.
-
#\97
-
#\b
-
#\a
-
Compile time error
D
Correct answer
Explanation
integer->char expects an integer code (like 97 for #a). exact->inexact converts 97 to 97.0 (a float). integer->char cannot accept a float - it requires an exact integer. This causes a compile-time error.
-
DrScheme
-
Sh
-
Error : string-set! accepts 1 argument, given 3
-
Error: string-set!: expects type <mutable string> as 1st argument, given "DrScheme"
D
Correct answer
Explanation
string-set! modifies a string character in-place. However, string literals like "DrScheme" are immutable (cannot be changed). The function expects a mutable string, but a string literal is immutable. Hence the error about expecting a mutable string.
-
Flash Player 8
-
Flash Player 9
-
Flash Player 10
-
Flash Player 11
C
Correct answer
Explanation
The FileReference.save() method was introduced in Flash Player 10 as part of the file reference API enhancements. It allows applications to save files to the user's local filesystem. Earlier versions (8 and 9) did not have this capability for security reasons.
B
Correct answer
Explanation
CLR (Common Language Runtime) is the correct answer because it is the runtime environment provided by the .NET Framework that manages code execution, memory management, and other services. RMT (A) is not a .NET component, JIT (C) is a compiler that works within CLR, and MSIL (D) is the intermediate language code, not the runtime environment.
-
Session objects
-
Application objects
-
ViewState
-
All the Above
-
Master Page
-
Page Class
-
Session Class
-
None of the Above
B
Correct answer
Explanation
Page Class is correct because all ASP.NET Web Forms inherit from the System.Web.UI.Page class, which provides the base functionality for web pages. Master Page (A) is used for consistent layouts but is not the base class, Session Class (C) manages state, and 'None of the Above' is incorrect.
-
Foo b = a;
-
Foo b = a.clone();
-
Foo b;b=a;
-
-
B
Correct answer
Explanation
Foo b = a.clone() is correct because calling clone() creates a new object with the same contents as the original. Foo b = a (A) only copies the reference, not the object itself. Foo b; b=a (C) is the same as A. Option D is invalid.
A
Correct answer
Explanation
True is correct because C++ is a compiled language that converts source code directly to machine code, which the operating system can execute directly. Unlike interpreted languages or languages that compile to bytecode (like Java), C++ produces native machine code that runs without a runtime interpreter.
-
Rule-Connect-SOAP
-
Rule-Connect-WebService
-
Connector
-
Rule-Service-SOAP
A
Correct answer
Explanation
In Pega PRPC, Rule-Connect-SOAP is the rule type used to connect to SOAP-based web services for fetching data. Rule-Connect-WebService is a more generic connector, but Rule-Connect-SOAP is specifically designed for SOAP services which is what the question asks about.
-
Rule-Obj-Flow
-
Rule-Activity
-
Rule-Obj-Activity
-
They are each separate rule types
C
Correct answer
Explanation
In Pega, Router, Notify, and Utility shapes in a flow rule execute activities. All activities are instances of the Rule-Obj-Activity rule type, with their specific behavior type (like Router or Utility) specified in their Security tab.
-
Pure C++
-
Any file type on a web server
-
Pure C#
-
Pure Java
A
Correct answer
Explanation
C and C++ allow direct memory access and lack automatic bounds checking, making them vulnerable to buffer overflows. Languages like Java and C# have built-in bounds checking and type safety that prevent buffer overflows in normal usage.
-
Java sand box environment provides protection against decompilation
-
Java is compiled into ELF binaries and cannot be decompiled
-
Java byte code can always be decompiled, code obfuscators can make the reverse engineering process more time confusing but cannot prevent it
-
Java is difficult to decompile because the Just-In-Time compiler automatically perform string encryption by default
C
Correct answer
Explanation
Java bytecode can be decompiled to recover readable source code. Code obfuscators make reverse engineering harder by renaming variables and adding control flow complexity, but cannot prevent decompilation entirely. The sandbox protects against runtime threats, not decompilation.