Recall & Review
beginner
What is the recommended naming style for classes in C#?
Classes should use PascalCase, where each word starts with a capital letter and no underscores are used. Example:
CustomerOrder.Click to reveal answer
beginner
How should private fields be named in C#?
Private fields typically use camelCase with a leading underscore. Example:
_totalAmount.Click to reveal answer
beginner
What naming convention is used for methods in C#?
Methods should use PascalCase. Each word starts with a capital letter and no underscores. Example:
CalculateTotal().Click to reveal answer
intermediate
How are constants named in C#?
Constants use PascalCase without underscores. Example:
MaxItems. Avoid all uppercase with underscores.Click to reveal answer
beginner
What is the naming style for interfaces in C#?
Interfaces use PascalCase and start with the letter
I. Example: IShape.Click to reveal answer
Which naming style is recommended for C# method names?
✗ Incorrect
Methods in C# should use PascalCase, starting each word with a capital letter.
How should private fields be named in C#?
✗ Incorrect
Private fields use camelCase with a leading underscore, like _myField.
What prefix is used for interface names in C#?
✗ Incorrect
Interfaces start with 'I' followed by PascalCase, e.g., ICustomer.
Which naming style is NOT recommended for constants in C#?
✗ Incorrect
Constants should use PascalCase, not ALL_CAPS with underscores.
Which of these is a correct class name in C#?
✗ Incorrect
Class names use PascalCase without underscores, like CustomerOrder.
Explain the naming conventions for classes, methods, and private fields in C#.
Think about how each type of identifier looks and starts.
You got /3 concepts.
Describe how interfaces and constants should be named in C# and why.
Consider the special prefix for interfaces and the style for constants.
You got /3 concepts.