0

Basic C# .net Quiz

Description: Basic C# .net Quiz
Number of Questions: 15
Created by:
Tags: .net c-sharp
Attempted 0/15 Correct 0 Score 0
  1. Class

  2. Constructor

  3. Object

  4. a and b


Correct Option: C
  1. The result of a users action

  2. result of a party

  3. code to force users action


Correct Option: A
Explanation:

To determine the correct answer, let's go through each option and explain why it is right or wrong:

A. The result of a user's action: This option is correct. An event is typically defined as the result of a user's action. In computer programming, an event can be triggered by user input, such as clicking a button or typing on a keyboard. The system responds to these actions by executing certain code or performing specific actions.

B. The result of a party: This option is incorrect. An event is not related to a party. In the context of computer programming, an event refers to user actions and their corresponding effects.

C. Code to force a user's action: This option is incorrect. An event is not code designed to force a user's action. Instead, events are typically triggered by user actions and are followed by specific reactions or responses from the system.

Therefore, the correct answer is A. The result of a user's action.

  1. a Wahsington representative

  2. a class that encapsulates methods

  3. a means of passing arrays into methods

  4. a substitue for an inherited method


Correct Option: B
Explanation:

To answer this question, the user needs to have knowledge about programming concepts, particularly about delegates.

The correct answer is:

B. a class that encapsulates methods

Explanation:

In .NET programming, a delegate is a type that defines a method signature. It encapsulates one or more methods, allowing them to be passed around as objects. A delegate is a reference type that can be used to encapsulate a named or an anonymous method. Delegates are used extensively in event handling and call-back scenarios, where they provide a way to define a method to be called when a certain event occurs. Thus, option B is the correct answer.

Option A is incorrect because a delegate is not related to a Washington representative.

Option C is incorrect because a delegate does not provide a means of passing arrays into methods.

Option D is incorrect because a delegate is not a substitute for an inherited method.

  1. True

  2. False


Correct Option: A
Explanation:

To solve this question, the user needs to know the concept of passing methods as arguments in programming.

The answer to this question is:

The Answer is: A

Explanation:

In programming, it is possible to pass methods as arguments for other methods without modification. This is a common practice in functional programming, where functions are treated as first-class citizens. By passing functions as arguments, you can create more generic and reusable code.

For example, in Python, you can pass a function as an argument to another function using the following syntax:

def my_func(func):
    # Do some work
    func()
    # Do some more work

def my_other_func():
    print("Hello, world!")

my_func(my_other_func)

In this example, my_func takes a function func as an argument and calls it during its execution. The my_other_func function is defined separately and passed to my_func as an argument. When my_func is called with my_other_func as its argument, it will execute my_other_func and print "Hello, world!".

Therefore, option A is correct.

  1. class MyClass IFace

  2. class MyClass ; IFace

  3. class MyClass : IFace

  4. class MyCalss {IFace}

  5. class MyCalss(IFace)


Correct Option: C
Explanation:

To properly implement an interface in a class, you would use the syntax specified in option C: class MyClass : IFace.

The colon (:) is used to indicate that the class MyClass is implementing the IFace interface. This allows the class to inherit the methods and properties defined in the interface.

Options A, B, D, and E do not follow the correct syntax for implementing an interface.

Option A, class MyClass IFace, is incorrect because it does not indicate that MyClass is implementing the IFace interface.

Option B, class MyClass ; IFace, is incorrect because the semicolon (;) is not used to indicate interface implementation.

Option D, class MyCalss {IFace}, is incorrect because the interface implementation is not specified after the class declaration.

Option E, class MyCalss(IFace), is incorrect because parentheses are not used to indicate interface implementation.

Therefore, the correct answer is C. class MyClass : IFace.

  1. inherit the properties of the interface

  2. contain the same methods as the interface

  3. create an interface objects

  4. a and b

  5. all of the above


Correct Option: E
  1. Compose good code with C#

  2. Compose C# projects with different objects

  3. Reduce errors by remaining composed during programming

  4. all of the above


Correct Option: B
  1. Override the parent class methods but maintain the implementation

  2. Maintain the same return type and arguments as the parent class, but implement it differently

  3. Have different return types and arguments than the parent class

  4. Are Virtual


Correct Option: B
  1. Pulse

  2. PulseAll

  3. Interrupt

  4. Resume

  5. ReStart


Correct Option: D

In order to lock/unlock an object use the.

  1. Lock and Unlock methods

  2. Enter and Exit methods

  3. Close and Open methods

  4. Close and Allow methods


Correct Option: B

Class String and the Char structure found in the:

  1. System.Strings namespace

  2. System.Text namespace

  3. System.Chars namespace

  4. System namespace


Correct Option: D
  1. only contains one character

  2. contains numbers rather than letters

  3. sequence of characters in double quotation marks

  4. contains exactly its variable name and nothing else


Correct Option: C
- Hide questions