Baza znanjaIzpitno središče
SLSlovenščina
Izberi jezik13

CKTIS / C#

true: praktična referenca

true: praktična referenca: true je literal bool, ki označuje resnico.

Različica: C# language; verified against C# 14 reference

Sintaksa

true /* grammar-specific form */

true je literal bool, ki označuje resnico.

Jasen pogoj uporabite neposredno, namesto da ga primerjate z == true.

Uporabniški tip lahko preobremeni operator true in false z lastno logiko.

Nullable je lahko tudi null in zato zahteva izrecno obravnavo tretjega stanja.

Celoten program dejansko uporabi true; natančno pričakovani stdout je True.

Primeri

using System;
using System.Buffers;
using System.Collections.Concurrent;
using System.Collections.Frozen;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
using System.Text.Json;
using System.Text.Json.Nodes;
using System.Text.Json.Serialization;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Channels;
using System.Threading.Tasks;
using Number = System.Int32;

Console.WriteLine(true);

Rezultat

True

Celoten program dejansko uporabi `true`; natančno pričakovani stdout je `True`.

Viri