C#.NET Multiple choices

Total available count: 28
Subject - Microsoft Technologies
Subsubject - C#.NET

What is the default boolean value in C#?







The default boolean value in C# false:
The bool type is the result type of comparison and equality operators. A bool expression can be a controlling conditional expression in the if, do, while, and for statements and in the conditional operator ?:. 

bool a = default(bool);

We have used the default keyword to get the default value in the above code.

Let us see the below example code to display the default value of bool,

using System;

public class Demo {
  public static void Main() {
  bool a = default(bool);
  // default for bool
  Console.WriteLine("Default for bool type = "+a);

The following is the output. It shows a blank space i.e. False.

Default for bool type = False


Next 1 multiple choice(s)


What are the pillars of Object-Oriented Programming?