1. Home
  2. Computer Science MCQs
  3. Dot NET
  4. In .NET 8, which keyword creates a primary constructor in…

Added 14 Sep 2025

In .NET 8, which keyword creates a primary constructor in a record?

  1. this
  2. base
  3. record ( ) Correct answer
  4. new ( )

Correct answer

C. record ( )

16 views

MCQSEXAM

Explanation

C# 12 (shipped with .NET 8) allows primary constructors directly inside the record header.

Reference

https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-12#primary-constructors

Doubts & discussion

Not sure why the answer is C? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More Dot NET MCQs

Practise all Dot NET MCQs

Similar MCQs