
C# Basics
Variables & constants, primitive types, control flow, classes, structs, interfaces, exceptions
1What is a variable in C#?
What is a variable in C#?
Antwoord
A variable is a named storage location in memory that holds a value which can be modified during program execution. Each variable has a type that determines what values it can contain and what operations are allowed. Declaring a variable with an explicit type allows the compiler to verify code consistency and optimize memory usage.
2What is the difference between a variable and a constant in C#?
What is the difference between a variable and a constant in C#?
Antwoord
A variable can have its value changed after initialization, whereas a constant receives a value at compilation that remains fixed throughout the program's lifetime. Constants are declared with the const keyword and must be initialized with a compile-time known value. Using constants for immutable values improves readability and enables compiler optimizations.
3What is the appropriate type to store a simple integer in C#?
What is the appropriate type to store a simple integer in C#?
Antwoord
The int type is the most commonly used integer type in C# for storing whole numbers. It occupies 32 bits in memory and can hold values ranging from approximately -2 billion to +2 billion. For most use cases involving counters, indices, or quantities, int provides a good balance between value range and performance.
What type should be used to store a true/false value in C#?
What is the correct syntax to declare a constant in C#?
+22 gespreksvragen
Andere .NET-sollicitatieonderwerpen
LINQ & Delegates
C# Language Essentials
ASP.NET Core Fundamentals
ASP.NET Core Request Lifecycle
Configuration & Settings
Application Lifecycle
Dependency Injection
Entity Framework Core
Minimal APIs
Web API Development
Async in ASP.NET Core
Authentication & Authorization
HttpClient & Networking
JSON Serialization
Entity Framework Core Advanced
C# Advanced Features
Clean Architecture
Logging, Monitoring & Observability
Unit Testing & xUnit
Integration Testing
Docker & Containerization
NuGet Package Management
Memory Management & GC
Reactive Programming
Async/await & Patterns
.NET Design Patterns
Performance Optimization
Security & Best Practices
SignalR & Real-time
Microservices Architecture
Beheers .NET voor je volgende gesprek
Krijg toegang tot alle vragen, flashcards, technische tests, code review-oefeningen en gespreksimulatoren.
Begin gratis