EDUCBA

EDUCBA

MENUMENU
  • Free Tutorials
  • Free Courses
  • Certification Courses
  • 600+ Courses All in One Bundle
  • Login

C# Commands

By Priya PedamkarPriya Pedamkar

Home » Software Development » Software Development Tutorials » C# Tutorial » C# Commands

C# Commands

Introduction of C# Commands

C# is actually called as C sharp. C sharp is a very much popular programming language which is strongly followed object-oriented programming concept with proper typing, functional, declarative, imperative, and generic and following the proper discipline of normal component-oriented programming concept.

Basic C# Commands

There has a lot of C# commands especially for running or handling any kind of critical business logic through proper object-oriented programming concept in C sharp environment. Some of the basic C# commands are mentioned below:

Start Your Free Software Development Course

Web development, programming languages, Software testing & others

1.Using

This keyword has been used as the first statement for any C# programming. It is basically indicating one of the basic keywords for mentioning namespace in any C sharp programming. There has a big possibility of having multiple using the keyword in one C sharp big programming code.
Using the system

2.Class

This is one of the big keywords has been using for declaring one specific class in case of C sharp programming.

Class User{
….
}

3.Comments

Comments are very much frequently used for any kind of programming language. But the definition of comments can be different for each type of language. Comments are normally used for mentioning compiler that commented code should not need to consider for compiling. In the case of C sharp, two kinds of commands are using for comments the code,

  • Using ‘/*….*/’ keyword for avoiding multiple lines of code from compiling.
  • Using ‘/’ for avoiding a single line of code from compiling.

4.Member or Class Variable

Member or class variable can be considered as an Instance variable. This kind of variable is normally defined in the class definition. Those variables are available everywhere in the class, every individual method can easily access those variables as per their requirement. And any value changes on that variable will be affected for all the methods at a time.

Popular Course in this category
C# Training Program (6 Courses, 17 Projects)6 Online Courses | 17 Hands-on Project | 89+ Hours | Verifiable Certificate of Completion | Lifetime Access
4.6 (8,847 ratings)
Course Price

View Course

Related Courses
ASP.NET Training (8 Courses, 19 Projects).NET Training Program (4 Courses, 19 Projects)

5.Instantiating of an Object

Instantiation of a class is always be required in case of object-oriented programming concept for using that class method or variables. Class instantiation can be done for those classes which actually holding the main method. Normally after the instantiation of each class, the main method will call directly.

6.Identifier

An identifier is very much required in case of C# programmer for declaring anything like Class, Variables etc. This identifier is basically very much helpful for identifying the specific class, functions or variables or any kind of C# programming item which are user-defined. The very basic rules which are needs to be followed by the developer in case of C# programming are:

  • A name should need to start with a letter or sequence of the letter. It can hold digits like 0-9 or underscore (_). But starting of the identifier name should be a letter, digit will not accept in case of C# programming.
  • It should not ever contain any kind of symbolic language available in the keyboard like +, -, !, @, #, $, %, ^, &, *, (, ), / etc. Only underscore (_) is one of the accepted identifiers for mention name in C# programming.
  • Identifier never is a common keyword of C#.

Intermediate C# Commands

There have several other popular C# commands also been used by the developer, which are not very basic commands but working with C# more those C# commands are very much required to execute. Some of those kinds of requiring intermediate C# commands are mentioned below:

1.Keywords

C# programming has varieties of special keywords which can be used by the developer very frequently. Those keywords are actually some of the reserved words which are known to the C# compiler. Some of the very much popular keywords of C# programming are abstract, as, break, byte, case, char, decimal, default, else, event, finally, float, for each, goto, if, int, lock, long, new, null, object, out, private, public, read-only, return, short, sizeOf, String, switch, this, try, unchecked, using, virtual, void, while, volatile etc. And some of the contextual keywords are ascending, descending, from, global, get, into, join, remove, select etc.

2.Common Variables

  • Value Type Variable

This type of variable is mainly used for assigning some value directly. This is derived from one the common package of C# programming name is System. value Type. This kind of variables is bool, byte, char, double, decimal, int, float, long, short etc.

  • Reference Type Variable

This kind of reference type variable never contains its actual data at the time of using in programming by the developer. It just holds the specific reference of that variable or proper word we can say it hold the memory location of that specific variable. If somehow memory location got changed of that specific variable it will impact the entire programming.

  • Pointer Type Variable

A pointer type variable is mainly helping for storing proper memory address of another type. It is basically working like same as C or C++ programming language has been used the pointer in their case.

Advanced C# Commands Commands

Some of the advance C# commands are mentioned below:

Type Conversion

Two kinds of type of conversation can happen in the case of C# programming. Implicit Type conversion, which ensures the type-safe utility of C#, means converting some object class to its base class. Another type of conversion is explicit conversion, in that case, typecasting require, developer have to mention converted object type properly.

Constants

This is one of the key utility of C# for mentioning one variable as constant. In that case, any logic inside the programming will not able to modify the same variable values.

Tips and Tricks to use C# Commands

Some common tips and tricks followed by normal C# command frequent users. Those tips are tricks are mentioned below:

1.String normalization

When we are using string normalization, we have to be ensured of using to UpperInVariant rather than to LowerIntVariant, as Microsoft can able to optimize the code only in case of uppercase variables.

2.Avoiding the null issue

Better to practice of using the null coalescing operator for avoiding any kind of null related issue, In case of C#, the operator is asking the question (?).

Conclusion

C# programming is mainly designed by Microsoft for given proper object-oriented concept in the .NET framework. This is one of the key programming languages currently in the market for delivering varieties projects which are specifically running on .NET framework.

Recommended Articles

This has been a guide to C# Commands. Here we have discussed concept, basic, intermediate as well as advanced C# Commands along with tips and tricks to use effectively. You may also look at the following article to learn more – 

  1. C# Interface vs Abstract Class
  2. C# Interview Questions
  3. Uses Of C#
  4. C# Interface

C# Training Program (6 Courses, 17 Projects)

6 Online Courses

17 Hands-on Project

89+ Hours

Verifiable Certificate of Completion

Lifetime Access

Learn More

4 Shares
Share
Tweet
Share
Primary Sidebar
C sharp Tutorial
  • Basic
    • Uses Of C#
    • C# Versions
    • C# Data Types
    • Variables in C#
    • Namespaces in C#
    • C# Compilers
    • C# Keywords
    • Iterators in C#
    • Objects in C#
    • C# Object Dispose
    • C# object to XML
    • C# check object type
    • C# Object Serialization
    • Pointers in C#
    • C# Literals
    • C# Commands
    • C# Custom Attribute
    • Type Casting in C#
    • String vs String C#
    • C# Struct vs Class
  • Operators
    • Logical Operators in C#
    • Conditional Operators in C#
    • Bitwise Operators in C#
    • C# OR Operator
    • C# Ternary Operators
    • Operator Precedence in C#
  • Control Statement
    • C# if Statement
    • Else If in C#
    • Continue in C#
    • Break in C#
    • Switch Statement in C#
    • Goto Statement in C#
  • Loops
    • C# For Loop
    • C# While Loop
    • C# do-while loop
    • C# foreach Loop
  • Arrays
    • Arrays in C#
    • 2D Arrays in C#
    • C# Jagged Arrays
    • String Array in C#
    • C# Multidimensional Arrays
  • Constructor and Destructor
    • Constructor in C#
    • Copy Constructor in C#
    • Static Constructor in C#
    • Destructor in C#
  • overloading and overrideing
    • Overloading and Overriding in C#
    • Overloading in C#
    • Overriding in C#
    • Method Overloading in C#
    • Method Overriding in C#
    • Operator Overloading in C#
  • Functions
    • C# Functions
    • C# String Functions
    • Math Functions in C#
    • Recursive Function in C#
    • C# Anonymous Functions
    • C# Local Functions
    • Enum in C#
    • Trim() in C#
    • clone() in C#
    • C# random
    • C# String Format()
    • C# String Interpolation
    • C# StartsWith()
    • C# String IndexOf()
    • DateTime in C#
    • C# Nullable
    • C# nameof
    • C# checked
    • C# String PadLeft
    • Convert String to Double in C#
    • Convert int to String C#
    • String to Date C#
    • C# intern()
    • C# Stopwatch
    • C# DirectoryInfo
    • C# Compare()
    • C# Base
    • C# SOAP
    • Lock in C#
  • Advanced
    • Inheritance in C#
    • Exception Handling in C#
    • Types of Exception in C#
    • C# FileNotFoundException
    • C# NullReferenceException
    • C# OutOfMemoryException
    • C# StackOverflowException
    • Custom Exception in C#
    • What is Multithreading in C#
    • C# finally
    • C# System.IO
    • What is StringBuilder in C#
    • DataReader C#
    • BinaryWriter in C#
    • C# BinaryReader
    • TextWriter in C#
    • TextReader in C#
    • C# StringReader
    • C# StringWriter
    • C# StreamReader
    • C# StreamWriter
    • C# FileInfo
    • What is Design Pattern in C#?
    • Multithreading in C#
    • Sorting in C#
    • Bubble Sort in C#
    • C# SortedList
    • C# SortedSet
    • C# SortedDictionary
    • Abstract Class in C#
    • Access Modifiers in C#
    • C# Generics
    • Deserialization in C#
    • C# Thread
    • C# Thread Join
    • C# Thread Sleep
    • C# Thread Synchronization
    • C# Class
    • Sealed in C#
    • Sealed Class in C#
    • Polymorphism in C#
    • C# Call By Reference
    • Virtual Keyword in C# 
    • Yield Keyword in C#
    • Regular Expression in C#
    • C# Lambda Expression
    • C# Predicate
    • Convert Object to JSON C#
    • Checkbox in C#
    • C# MessageBox
    • Collections in C#
    • List in C#
    • C# LinkedList
    • Listbox in C#
    • Protected in C#
    • C# EventHandler
    • Private in C#
    • this Keyword in C#
    • Static Keyword in C#
    • C# Out Parameter
    • Assert in C#
    • C# Delegates
    • C# Interface
    • Generics in C#
    • Timer in C#
    • C# Serialization
    • Metadata in C#
    • C# Stack
    • C# Using Static
    • Queue in C#
    • C# File.Exists
    • C# Tuples
    • C# Create JSON Object
    • Partial in C#
    • C# readonly
    • C# Action Delegate
    • C# Await Async
    • C# Dictionary
    • IEnumerable C#
    • C# Data Grid View
    • C# Dynamic
    • Web Services in C#
    • C# Pattern Matching
    • C# Extension Methods
    • C# XmlSerializer
  • Programs
    • Patterns in C#
    • Swapping in C#
    • Palindrome in C#
    • Factorial in C#
    • Fibonacci Series in C#
    • Random Number Generator in C#
    • Prime Numbers in C#
    • Armstrong Number in C#
    • Reverse String in C#
  • Interview questions
    • C# Interview Questions and Answers
    • C# OOP Interview Questions
    • C# Design Pattern Interview Questions

Related Courses

C# Certification Training

ASP.NET Course

.NET Course

Footer
About Us
  • Blog
  • Who is EDUCBA?
  • Sign Up
  • Corporate Training
  • Certificate from Top Institutions
  • Contact Us
  • Verifiable Certificate
  • Reviews
  • Terms and Conditions
  • Privacy Policy
  •  
Apps
  • iPhone & iPad
  • Android
Resources
  • Free Courses
  • Java Tutorials
  • Python Tutorials
  • All Tutorials
Certification Courses
  • All Courses
  • Software Development Course - All in One Bundle
  • Become a Python Developer
  • Java Course
  • Become a Selenium Automation Tester
  • Become an IoT Developer
  • ASP.NET Course
  • VB.NET Course
  • PHP Course

© 2020 - EDUCBA. ALL RIGHTS RESERVED. THE CERTIFICATION NAMES ARE THE TRADEMARKS OF THEIR RESPECTIVE OWNERS.

EDUCBA Login

Forgot Password?

EDUCBA
Free Software Development Course

Web development, programming languages, Software testing & others

*Please provide your correct email id. Login details for this Free course will be emailed to you
Book Your One Instructor : One Learner Free Class

Let’s Get Started

This website or its third-party tools use cookies, which are necessary to its functioning and required to achieve the purposes illustrated in the cookie policy. By closing this banner, scrolling this page, clicking a link or continuing to browse otherwise, you agree to our Privacy Policy

EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA
Free Software Development Course

Web development, programming languages, Software testing & others

*Please provide your correct email id. Login details for this Free course will be emailed to you

Special Offer - C# Training Program (6 Courses, 17 Projects) Learn More