0

C# .Net Basic Quiz

Description: C# .Net Basic Quiz
Number of Questions: 10
Created by:
Tags: .net c-sharp
Attempted 0/10 Correct 0 Score 0
qn1
  1. 4.5

  2. 2

  3. 3

  4. None


Correct Option: A
Explanation:

To answer this question, the user needs to know about .NET Framework and its different versions.

The .NET Framework is a software framework developed by Microsoft that runs primarily on Microsoft Windows. It includes a large library of coded solutions to common programming problems and a virtual machine that manages the execution of programs written specifically for the framework.

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

A. 4.5: This option is not the latest version of .NET Framework. Although it was a popular version, the latest version of .NET Framework is higher than 4.5.

B. 2: This version is not the latest version of .NET Framework. .NET Framework 2 was released on January 22, 2006, and has since been superseded by newer versions.

C. 3: This version is not the latest version of .NET Framework. .NET Framework 3 was released on November 6, 2006, and has since been superseded by newer versions.

D. None: This option is not correct since there is a latest version of .NET Framework available.

Therefore, the correct answer is:

The Answer is: A. 4.5

C# supports multiple inheritance by using

qn2
  1. Interfaces

  2. Abstraction

  3. Classes

  4. None


Correct Option: A
Explanation:

To answer this question, the user needs to know the concept of inheritance in object-oriented programming and how it is implemented in C#.

C# does not support multiple inheritance with classes, which means a class cannot inherit from multiple classes at the same time. However, C# does support multiple inheritance with interfaces.

Interfaces are a way to define a set of methods and properties that a class must implement. A class can implement multiple interfaces, which allows it to inherit functionality from each interface.

Abstraction is a concept in object-oriented programming that allows you to define a set of methods or properties without providing an implementation. This allows other classes to inherit from the abstract class and provide their own implementations of the methods and properties.

Therefore, the correct answer is:

The Answer is: A. Interfaces

CTS Means

qn4
  1. Common Test System

  2. Common Type Service

  3. Common Type System

  4. None


Correct Option: C

CLR Means

qn3
  1. Common Language Runtime

  2. Command Line Runtime

  3. Custom Language Runtime

  4. None


Correct Option: A

Boxing means

qn6
  1. Converting reference type to value type

  2. Converting value type to reference type

  3. converting int to string

  4. none


Correct Option: B
qn5
  1. Converting objects to byte stream

  2. Converting objects to strings

  3. Converting objects to unicode characters

  4. None


Correct Option: A
Explanation:

To solve this question, the user needs to have knowledge about serialization. Serialization is the process of converting an object into a stream of bytes or characters, which can be stored or transmitted over a network.

Option A is correct. Serialization involves converting objects to byte streams, which can be easily transmitted over a network or stored in a file.

Option B is incorrect because serialization does not involve converting objects to strings. Although strings can be used to represent serialized data, they are not the same thing as serialization.

Option C is incorrect because serialization does not involve converting objects to Unicode characters. Unicode is a character encoding scheme that allows characters from different languages to be represented in a consistent manner. However, it is not directly related to serialization.

Option D is incorrect because serialization is a real concept that involves converting objects to byte streams or character streams.

Therefore, the correct answer is: A. Converting objects to byte stream.

qn7
  1. Converting reference type to value type

  2. Converting valuetype to reference type

  3. Converting int to string

  4. None


Correct Option: A

ExecutNonQuery doesn't suits for which type of commands

  1. Insert

  2. Delete

  3. Update

  4. Select


Correct Option: D
Explanation:

To solve this question, the user needs to know about the differences between various SQL commands and their effects on the database.

The ExecuteNonQuery method is used to execute SQL commands that do not return any data. Instead, it is used to execute commands that modify the data in the database.

Now, let's go through each option and explain whether or not it suits the ExecuteNonQuery method:

A. Insert: This option is correct. The Insert command is used to insert new data into a table, which changes the data in the database. Therefore, ExecuteNonQuery is suitable for executing Insert commands.

B. Delete: This option is correct. The Delete command is used to delete data from a table, which changes the data in the database. Therefore, ExecuteNonQuery is suitable for executing Delete commands.

C. Update: This option is correct. The Update command is used to modify existing data in a table, which changes the data in the database. Therefore, ExecuteNonQuery is suitable for executing Update commands.

D. Select: This option is incorrect. The Select command is used to retrieve data from a table and return it to the user. It does not modify the data in the table, so ExecuteNonQuery is not suitable for executing Select commands.

Therefore, the answer is: D.

qn9
  1. String

  2. Int

  3. bool

  4. Object


Correct Option: D
Explanation:

The ExecuteScalar method of a command object returns a single value from the first row of the result set returned by the query. The data type of the returned value depends on the type of the column being retrieved.

In this case, the options provided are:

A. String: This option is incorrect because the ExecuteScalar method does not always return a string. It can return values of different data types, depending on the column being retrieved.

B. Int: This option is incorrect because, similar to option A, the ExecuteScalar method does not always return an integer. It can return values of different data types.

C. bool: This option is incorrect for the same reasons mentioned above. The ExecuteScalar method can return values of different data types, not just boolean values.

D. Object: This option is correct. The ExecuteScalar method returns the value as an Object data type. This allows for flexibility in handling different data types returned by the query.

Therefore, the correct answer is D.

- Hide questions