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
-
IL Code
-
Native code
-
Byte Code
-
None of these
A
Correct answer
Explanation
The vbc.exe (Visual Basic Command-Line Compiler) generates IL (Intermediate Language) code, not native code. This IL code is then compiled to native code by the JIT (Just-In-Time) compiler at runtime by the CLR. This is consistent with how all .NET languages work - they compile to IL, not directly to native machine code.
-
With OPTION STRICT ON keyword
-
With OPTION EXPICIT Keyword
-
With OPTION STRICT OFF keyword
-
All the above
A
Correct answer
Explanation
The Option Strict On statement enforces strict type checking in VB.NET, preventing implicit narrowing conversions and late binding. Option Explicit ensures all variables are declared, while Option Strict Off disables strict type checks, making the first option the correct choice.
-
By setting the object to Null
-
With Close keyword
-
By setting the object to Nothing
-
None of the above
C
Correct answer
Explanation
VB.NET uses the Nothing keyword to release object references and allow garbage collection, which is equivalent to null in C#. The Null keyword does not exist in VB.NET, and Close is a method used for releasing resources, not dereferencing.
-
C,C++
-
Active X,Java
-
Dotnet
-
Options 1 and 3
-
Options 1 and 2
E
Correct answer
Explanation
Python integrates with C/C++ through the Python/C API and extensions like ctypes/pybind11. It integrates with Java via Jython (Python implementation on JVM), and with ActiveX/COM on Windows via pywin32. .NET integration exists through IronPython but is less commonly used in standard Python environments.
-
Fixing mistakes in programs is slow
-
It does not have debugging features built-in
-
Python in interpreted language can be tested as soon as it is wriiten,without waiting for its code to compile
-
It doesn't provide interface to major Databases
-
It has less text manipulation feature
C
Correct answer
Explanation
As an interpreted language, Python code can be executed immediately without compilation - you can test code as soon as you write it. Python includes debugging tools like pdb, has extensive text manipulation capabilities (string methods, regex via re module), and provides database interfaces (DB-API).
D
Correct answer
Explanation
Dojo is written in JavaScript. It's a pure JavaScript framework/toolkit that runs in the browser. While it can interact with server-side technologies and can be used in various development environments, the core Dojo toolkit itself is implemented in JavaScript.
C
Correct answer
Explanation
DYNAM is the COBOL compiler option used to enable dynamic calling/linking of subprograms. Options like REUS deal with reusability, and LET is a link-editor option, not a COBOL compiler option for dynamic linking.
B
Correct answer
Explanation
Oracle database is primarily developed in C programming language. The core database engine, memory management, and low-level system interfaces are written in C for portability and performance. While components may use other languages, C remains the foundational language for Oracle's development.
-
CreateObjRef
-
BeginExecuteNonQuery
-
Prepare
-
All of the above
D
Correct answer
Explanation
SqlCommand inherits CreateObjRef from MarshalByRefObject (base class of all .NET objects), implements BeginExecuteNonQuery for asynchronous query execution, and has Prepare to optimize parameterized commands. All three are valid methods available on a SqlCommand object.
-
It is invoked every 40 seconds until the process is destroyed.
-
It only occurs when the Collect method is explicitly invoked in the System.GC class.
-
It is invoked every time a constructor is called.
-
It is invoked when generation 0 does not have room for the newly created object.
-
It is invoked when the Dispose method is explicitly called.
D
Correct answer
Explanation
In the .NET garbage collector, memory allocation requests for small objects trigger a generation 0 collection when generation 0 lacks sufficient room to allocate the new object.
-
All .NET compilers produce only verifiably type-safe code.
-
Visual Basic .NET and C# produce verifiably type-safe code if you avoid certain constructs.
-
Only Visual C++ with Managed Extensions produces verifiably type-safe code.
-
Visual C++ with Managed Extensions produces verifiably type-safe code if you avoid certain constructs.
-
C++ and C# cannot produce verifiably type-safe code.
B
Correct answer
Explanation
Verifiably type-safe code passes the CLR's verification without throwing exceptions. C# and VB.NET produce verifiably type-safe code if you avoid unsafe constructs like pointers. Visual C++ with Managed Extensions defaults to unsafe code but can produce verifiable code if you avoid certain constructs. Not all .NET languages produce verifiable code by default.
-
Cannot prevent it
-
This type of situation will never arrise
-
Before performing your update, call DisableEventFiring(). After update, call EnableEventFiring().
-
Before performing your update, call EnableEventFiring(). After update, call DisableEventFiring().
-
None of the above
C
Correct answer
Explanation
When an event receiver updates the item it's handling, it can trigger recursive events. DisableEventFiring() before the update and EnableEventFiring() after prevents this recursion. This is a standard pattern in SharePoint event receivers. The order matters - disable first, then re-enable after.
D
Correct answer
Explanation
C is most susceptible to buffer overflow because it allows direct memory manipulation through pointers, lacks automatic bounds checking on array access, and requires manual memory management. Java has built-in bounds checking and garbage collection that prevent buffer overflows. COBOL has stronger memory safety features. ColdC is not a mainstream language with known buffer overflow issues.
-
Stack-based Architecture
-
Register-based Architecture
-
Queuing Method
-
None of above
B
Correct answer
Explanation
Dalvik VM uses register-based architecture rather than stack-based architecture. Register-based machines typically have fewer instructions and better performance for embedded systems compared to stack-based VMs like the JVM.
-
Java programming language
-
C language
-
C++ language
-
Objective-C
-
None of above
B
Correct answer
Explanation
Dalvik VM is written in C language, not Java. It's a clean-room VM implementation optimized for mobile devices, designed to run on systems with limited resources like memory and battery power.