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
-
Arithmetic operators
-
Relational operators
-
Bitwise operators
-
None of these
C
Correct answer
Explanation
These operators are used to perform operations at Bit-level as all data is stored in the computer's memory as a sequence of bits (0's and 1's) .
-
Lexical analysis
-
Syntax analysis
-
Code generation
-
None of these
C
Correct answer
Explanation
This phase of the compiler converts the intermediate code into a sequence of machine instructions.
-
Side by side execution
-
Enhancement parallel computing
-
Improved garbage collection
-
MEF
-
Dynamic language runtime
E
Correct answer
Explanation
This should be available for development.
-
Comman type security (CTS)
-
Common Language run time security (CLRS)
-
Base class library
-
Assembly language
-
Code access security (CAS)
E
Correct answer
Explanation
The source code of the assembly is taken as evidence to provide security in .NET framework. This feature is called CAS.
-
Common Language Specification
-
Programming Language Layer
-
VB.Net
-
C
-
Common Language Runtime
A
Correct answer
Explanation
CLS is a natural run time format.
-
MSIL
-
Compiler
-
CLS
-
CLR
-
None of the above
D
Correct answer
Explanation
This provides the run time environment to byte code, and it contains the converter.
-
N-version programming
-
Structured programming
-
Defensive programming
-
None of these
B
Correct answer
Explanation
Structured programming uses only while loop and control structures, but not goto statements.
-
MDAC
-
ADOX
-
ADOMD
-
ADO
-
Both 2 and 4
D
Correct answer
Explanation
ADO can be put directly with in ASP for communicating the data base.
-
delegate int ThisDelegate (int x)
-
public delegate int ThisDelegate (String x)
-
public delegate char ThisDelegate (String x)
-
delegate char ThisDelegate (String)
-
none of the above
D
Correct answer
Explanation
This declaration is incorrect as there is no parameter name defined for the String variable.
-
Unboxing can throw InvalidCastException at runtime.
-
In boxing, a copy of the value type is taken from the heap to the stack.
-
In unboxing, a copy of the value type is taken back from the heap to the stack.
-
Casting does not physically move or operate on the object.
-
Both (2) and (4).
B
Correct answer
Explanation
This is false as boxing refers to take the value type from the stack to the heap.
C
Correct answer
Explanation
The Abstract Window Toolkit (AWT) is Java's original platform-independent windowing, graphics, and user-interface widget toolkit. The AWT is now part of the Java Foundation Classes (JFC) — the standard API for providing a graphical user interface (GUI) for a Java program. AWT is also the GUI toolkit for a number of Java ME profiles.
-
PostScript
-
AppleScript
-
JavaScript
-
Tcl
-
Perl
A
Correct answer
Explanation
PostScript (PS) is a computer language for creating vector graphics. It is a dynamically typed, concatenative programming language.
-
C
-
Fortran
-
BASIC
-
JAVA
-
COBOL
D
Correct answer
Explanation
Java is a general-purpose, concurrent, class-based, object-oriented computer programming language that is specifically designed to have as few implementation dependencies as possible. It is intended to let application developers write once, run anywhere (WORA), meaning that code that runs on one platform does not need to be recompiled to run on another.
-
Line reconstruction
-
Lexical analysis
-
Preprocessing
-
Syntax analysis
-
Semantic analysis
B
Correct answer
Explanation
Lexical analysis breaks the source code text into small pieces called tokens. Each token is a single atomic unit of the language, for instance a keyword, identifier or symbol name. The token syntax is typically a regular language, so a finite state automaton constructed from a regular expression can be used to recognize it. This phase is also called lexing or scanning, and the software doing lexical analysis is called a lexical analyzer or scanner.
-
Deterministic context-free languages can be recognized by a deterministic turing machine.
-
They are a proper subset of context-free languages.
-
They can be accepted by a deterministic pushdown automaton.
-
They are closed under union.
-
They are closed under complement.
D
Correct answer
Explanation
DCFL is a subset of the complexity class SC. The set of deterministic context-free languages is not closed under union but is closed under complement.