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

Multiple choice technology programming languages
  1. IL Code

  2. Native code

  3. Byte Code

  4. None of these

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology programming languages
  1. With OPTION STRICT ON keyword

  2. With OPTION EXPICIT Keyword

  3. With OPTION STRICT OFF keyword

  4. All the above

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology programming languages
  1. By setting the object to Null

  2. With Close keyword

  3. By setting the object to Nothing

  4. None of the above

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology programming languages
  1. C,C++

  2. Active X,Java

  3. Dotnet

  4. Options 1 and 3

  5. Options 1 and 2

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology programming languages
  1. Fixing mistakes in programs is slow

  2. It does not have debugging features built-in

  3. Python in interpreted language can be tested as soon as it is wriiten,without waiting for its code to compile

  4. It doesn't provide interface to major Databases

  5. It has less text manipulation feature

Reveal answer Fill a bubble to check yourself
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).

Multiple choice technology web technology
  1. C++

  2. Java

  3. VB

  4. Javascript

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology
  1. Java

  2. C

  3. C++

  4. Ada

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology programming languages
  1. CreateObjRef

  2. BeginExecuteNonQuery

  3. Prepare

  4. All of the above

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology web technology
  1. It is invoked every 40 seconds until the process is destroyed.

  2. It only occurs when the Collect method is explicitly invoked in the System.GC class.

  3. It is invoked every time a constructor is called.

  4. It is invoked when generation 0 does not have room for the newly created object.

  5. It is invoked when the Dispose method is explicitly called.

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology web technology
  1. All .NET compilers produce only verifiably type-safe code.

  2. Visual Basic .NET and C# produce verifiably type-safe code if you avoid certain constructs.

  3. Only Visual C++ with Managed Extensions produces verifiably type-safe code.

  4. Visual C++ with Managed Extensions produces verifiably type-safe code if you avoid certain constructs.

  5. C++ and C# cannot produce verifiably type-safe code.

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology web technology
  1. Cannot prevent it

  2. This type of situation will never arrise

  3. Before performing your update, call DisableEventFiring(). After update, call EnableEventFiring().

  4. Before performing your update, call EnableEventFiring(). After update, call DisableEventFiring().

  5. None of the above

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology security
  1. COBOL

  2. ColdC

  3. Java

  4. C

Reveal answer Fill a bubble to check yourself
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.

Multiple choice technology platforms and products
  1. Java programming language

  2. C language

  3. C++ language

  4. Objective-C

  5. None of above

Reveal answer Fill a bubble to check yourself
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.