Learn c#
  • Overview
  • Chapter 0 c# vs .net
  • Chapter 1 Definitions
    • Data Types (Primitive Types)
    • Variables
    • Overflow
    • Identifiers
    • Comments
  • Chapter 2 Type Conversions
  • Chapter 3 C# Operators
  • Chapter 4 Non-Primitive Types
    • Reference Types and value types
    • Class, Fields, property
    • Structs and Arrays
    • Strings
    • Enums
  • Chapter 5 Conditional statements and Loops
    • Conditional Statements
    • Random Class
  • External Links
    • cSharp-Station
    • cSharp corner
    • CodeProject
    • cSharp Guide by Microsoft
  • Tips
Powered by GitBook
On this page
  1. Chapter 1 Definitions

Comments

A comment is text that we put in our code to improve readability and maintainability. There are two common styles to write comments in C# programs:

A single-line comment: prefix it with double slash:

// This is a one-line comment

A multi-line comment: use /* to start the comment and */ to finish it:

/* My comment starts here

and finises here.

*/

Don't use comments to explain what your code does. use it only when it is needed for sure.

PreviousIdentifiersNextChapter 2 Type Conversions

Last updated 6 years ago