- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Naming Conventions in C#
Naming convetion for classes
A class definition starts with the keyword class followed by the class name; and the class body enclosed by a pair of curly braces. The following are the conventions for class names.
Pascal Casing
The coding conventions for a class name is the the name of the class names, for example, it should being PascalCasing.
public class EmployeeDetails {}
Above, the class name EmployeeDetails is in PascalCasing.
Noun or Noun Phrases
Prefer adding class names as noun or noun phrases −
public class Employee {}
Identifier is a name used to identify a class, variable, function, or any other user-defined item.The following are the naming convetions for Identifiers −
A name must begin with a letter that could be followed by a sequence of letters, digits (0 - 9) or underscore. The first character in an identifier cannot be a digit.
It must not contain any embedded space or symbol such as? - + ! @ # % ^ & * ( ) [ ] { } . ; : " ' / and \. However, an underscore ( _ ) can be used.
It should not be a C# keyword.