programming languages Online Quiz - 152
|Description: programming languages Online Quiz - 152
|Number of Questions: 20
|Created by: Aliensbrain Bot
|Tags: programming languages
A ‘Queue’ Collection provides ‘first-in-first-out’ functionality:
What is the operator that is used to cast up & down the inheritance hierarchy?
What is the output of the following code in Test class Class Myclass Dim Num as Integer Private Sub New (i as integer) Num=I End sub End class Class Test Sub Main() Dim c as Myclass C=New Myclass (10) End sub End Class Num variable of Myclass is initialized to 10
To answer this question, let's analyze the code step by step:
First, we have the definition of the
Myclass class. This class has one member variable
Num of type
Integer and a constructor
New that takes an
i and assigns its value to the
Next, we have the
Test class, which contains the
Main method. In the
Main method, an instance of the
Myclass class is created and assigned to the variable
c. The constructor
New is called with the argument
Now, let's go through each option to understand why it is correct or incorrect:
Option A) Run Time Error - This option is incorrect. There are no runtime errors in the given code. The code will execute without any exceptions.
Option B) Compiler Error - This option is correct. The code will not compile due to a compiler error. The issue is with the line
C=New Myclass (10). In VB.NET, the
New keyword is not used to create instances of classes. Instead, you can directly call the constructor like
C = Myclass(10). The correct syntax for creating an instance of the
Myclass class and assigning it to the variable
c would be
c = New Myclass(10).
Option C) StackOverflow Exception - This option is incorrect. There is no recursive or infinite looping code in the given code, so a
StackOverflowException will not occur.
Option D) NONE - This option is incorrect. As explained above, the correct answer is Option B.
The correct answer is B) Compiler Error. This option is correct because the code will not compile due to a syntax error in the line
C=New Myclass (10).
Which program will you use to assemble a program written in IL
Assembly manifest contains
To answer this question, we need to understand what an assembly manifest is.
An assembly manifest is a text file that contains metadata about an assembly. It provides information about the assembly's version, culture, dependencies, and other relevant details. The manifest is an essential component of the assembly, as it allows the runtime to resolve and load the assembly correctly.
The assembly manifest contains two main components:
A. Assembly's Identity: This component includes information about the assembly's name, version number, public key token (if the assembly is strongly named), and culture. The assembly's identity is crucial in distinguishing it from other assemblies and ensuring that the correct version is loaded.
B. Assembly's Reference List: This component lists the dependencies that the assembly requires to function correctly. It includes references to other assemblies or external components that the assembly relies on. The reference list helps the runtime locate and load the necessary dependencies when the assembly is executed.
Therefore, the correct answer is C) Both A & B. The assembly manifest contains both the assembly's identity and its reference list.
A final class can be extended
Vector is synchronized whereas arraylist is not.
- What does XML stand for?
Comment in XML document is given by
Well formed XML document means
For XML Parser to ignore a certain section of XML Document, which syntax is correct?