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
D
Correct answer
Explanation
In Visual Basic, forms have built-in methods like Refresh, Show, Hide, and Move. Point and Pset are graphics methods used for drawing on forms or picture boxes. Open is a file I/O statement used to access files, not a forms method. Therefore, Open is not a forms method.
-
Size
-
Resize
-
Sizechange
-
Resizewindows
B
Correct answer
Explanation
When a form is resized by the user or programmatically, Visual Basic triggers the Resize event. This event allows developers to execute code in response to size changes, such as repositioning controls or adjusting layouts. The other options (Size, Sizechange, Resizewindows) are not standard VB events.
-
Help mode
-
Design mode
-
Break mode
-
Run mode
A
Correct answer
Explanation
Visual Basic has three primary working modes: Design mode (for creating interface), Run mode (for executing the application), and Break mode (for debugging during execution). Help mode is not one of these operational states - it's just accessing documentation, not a working mode of the IDE itself.
C
Correct answer
Explanation
When you create a new project in Visual Basic, it automatically includes one form named Form1 by default. Additional forms can be added with names like Form2, Form3, etc., but Form1 is always the initial form. The other options (Form10, Forms, Form0) are not default VB naming conventions.
-
It means that the MSIL code cannot be JIT compiled by the CLR.
-
It provides the JIT code prevention.
-
In the stage of the verification process, the type safety is analysed after the declaration of the code.
-
The code passes the type-safety check. The CLR accepts that code is both valid and type-safe and allows it to be executed or referenced.
-
It makes the code typesafe.
A
Correct answer
Explanation
This is correct as it means JIT compiled code validity is not confirmed.
-
It is a standard, GUIless, console Window.
-
It is the standard .NET Windows executable file.
-
It is the standard .NET class library, which can be dynamically linked.
-
It is the standard class module, which is used as a container for compiled classes.
-
It manages the namespace of the assembly code.
B
Correct answer
Explanation
This is correct about Windows Executable assembly.
-
These occur when the environment you're programming in doesn't understand the code.
-
These errors occur when the programme is running.
-
An example is trying to access a file that doesn't exist.
-
This happens when the code doesn't quite behave the way it was supposed to.
-
These errors are responsible for robust code.
A
Correct answer
Explanation
This is a correct statement as the Design errors are the outcome of bad coding practices.
-
In this execution, the multiple versions of the same assembly can be managed and executed.
-
This execution has delivered the user from complications associated with DLL hell.
-
It is possible in an executable assembly to express a dependence on a particular support assembly.
-
It manage the execution process in dynamic assembly only.
-
The multiple versions of the assembly can be encrypted.
D
Correct answer
Explanation
This is incorrect because it can manage the execution process in any assembly.
-
The array can be redeclared implicitly.
-
It makes the preservation of the data of the original array.
-
It can be used to change an array from one data type to another.
-
It can produce exception in the code.
-
It produces the complexity problem in the code.
B
Correct answer
Explanation
This is correct because the ability to keep expanding the array is needed.
-
It is used to declare the name of a module and introduces the definition of the variables.
-
It is used to declare the name of an interface and introduces the definitions of the members.
-
It declares the name, parameters, and code that defines a Function procedure.
-
It declares the name, parameters and code that define a Sub procedure.
-
It defines the name of the module and the variables.
A
Correct answer
Explanation
This is correct and it includes the definition of the variables, properties, events and procedures that the module comprises.
-
using System.log
-
using System.Diagnostics
-
using System.Event
-
None of these
B
Correct answer
Explanation
The System.Diagnostics namespace in .NET Framework provides classes for event logging (EventLog, EventLogEntry, EventLogInstaller) and other diagnostics features like performance counters and process tracing. This namespace is the correct location for event log functionality.
-
Reference Parameters
-
Output Parameters
-
Aliases
-
Both (1) and (2)
D
Correct answer
Explanation
In languages like C#, both reference parameters (using ref) and output parameters (using out) allow a method to modify and return multiple values back to the calling code. Therefore, both options enable changing multiple values.
B
Correct answer
Explanation
'Of' is not a reserved keyword in C#. Is, As, and In are all contextual keywords/reserved words. 'Of' is only used in generic type constraints (where T : IEnumerable) but is not a standalone keyword.
-
namespace directive
-
import keyword
-
import construct
-
the keyword ''Using�
D
Correct answer
Explanation
C# uses the 'using' keyword to import namespaces. Option D shows 'the keyword 'Using' which is correct despite encoding artifacts. Namespace directives declare namespaces but don't import them. 'import' is not valid C# syntax.
-
First line
-
Last Line
-
Anywhere in the code
-
None of these
A
Correct answer
Explanation
OPTION EXPLICIT must be placed on the FIRST line of ASP code to force variable declaration. This directive affects the entire script and must appear before any executable code. Placing it elsewhere would be ineffective.