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. C++

  2. C#

  3. JAVA

  4. VB

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

C# is the primary language designed for the .NET Framework and makes the best use of the CLR. While VB.NET and managed C++ also compile to IL and run on the CLR, C# was designed alongside the CLR and provides the most natural mapping to its features. Java runs on its own JVM, and standard C++ doesn't use a runtime in the same way.

Multiple choice technology programming languages
  1. Nullable<bool> b=null;

  2. bool b=null;

  3. <Nullable> bool b=null;

  4. bool b= <Nullable>;

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

The Nullable struct allows value types to be assigned null, which isn't possible for regular value types. Nullable can hold true, false, or null. Option A uses the correct generic Nullable syntax. Regular bool variables cannot be assigned null directly.

Multiple choice technology programming languages
  1. Data Conversion

  2. Interfacing

  3. Boxing

  4. Casting

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

Casting is the process of converting a value from one data type to another. This can be implicit (safe conversion) or explicit (requiring a cast operator). Boxing specifically refers to converting a value type to a reference type, which is a special case of type conversion. Data conversion is a broader term that includes casting.

Multiple choice technology programming languages
  1. True

  2. False

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

In C#, reference type variables store memory addresses, so multiple variables can reference the same object on the heap. Changing the object through one reference affects all references to that object. This is a fundamental difference from value types, where each variable has its own copy of the data.

Multiple choice technology programming languages
  1. Identification Division

  2. Linkage Division

  3. Data Division

  4. Procedure Division

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The four main divisions in a COBOL program are Identification, Environment, Data, and Procedure. The Linkage Section is a component within the Data Division used for parameter passing, rather than a standalone division.

Multiple choice technology architecture
  1. .NET Framework 2.0 CLR was was introduced with VS 2005

  2. .Net Framework 3.0 uses the .NET Framework 2.0 CLR

  3. .Net Framework 3.5 uses the .NET Framework 2.0 CLR

  4. .Net Framework 3.5 SP1 first time introduce the .NET Framework 3.0 CLR

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

To answer this question, the user needs to have knowledge about Common Language Runtime (CLR), which is the virtual machine component of Microsoft's .NET framework that executes .NET programs.

Now, let's go through each option and explain why it is right or wrong:

A. .NET Framework 2.0 CLR was introduced with VS 2005: This statement is true. The CLR version 2.0 was introduced with Visual Studio 2005 and the .NET Framework 2.0.

B. .Net Framework 3.0 uses the .NET Framework 2.0 CLR: This statement is true. The .Net Framework 3.0 is just an add-on to the .Net Framework 2.0, and it uses the same CLR version 2.0.

C. .Net Framework 3.5 uses the .NET Framework 2.0 CLR: This statement is true. The .Net Framework 3.5 is built on top of the .Net Framework 2.0 and uses the same CLR version 2.0.

D. .Net Framework 3.5 SP1 first time introduced the .NET Framework 3.0 CLR: This statement is false. The .Net Framework 3.5 SP1 did not introduce the .NET Framework 3.0 CLR. It still uses the same CLR version 2.0.

Therefore, the answer is: D.

Multiple choice technology mainframe
  1. NDA

  2. SDA

  3. GDA

  4. KDA

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

GDA (Global Data Area) is a Data Definition Module in Natural, used to define data structures accessible across multiple programs. LDA (Local Data Area) and PDA (Parameter Data Area) are also data definition modules, but NDA, SDA, and KDA are not standard Natural data area types. GDAs allow shared data definitions that can be used by different Natural programs within the same library.

Multiple choice technology programming languages
  1. No

  2. In certain conditions

  3. Yes

  4. None

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

When an exception is thrown, the first matching catch block handles it and no other catch blocks execute for that exception. Multiple catches are for different exception types, not multiple executions. Control transfers to finally or after the catch blocks.

Multiple choice technology mainframe
  1. End

  2. Stop Run

  3. Stop

  4. End-If

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

STOP RUN is the COBOL statement that terminates program execution. It closes all files and returns control to the operating system. END is used to end procedures (like END-EVALUATE), not programs. STOP alone is incorrect. END-IF terminates an IF statement block, not the program.