Tutorials Navigation

Tutorials :: New :: Popular :: Top Rated

Tutorials: 18,326 Categories: 12

Total Tutorial Views: 41,459,521

[C#] How to declare variables (Simple)

Tutorial Name: [C#] How to declare variables (Simple)  

Category: PC Tutorials

Submitted By: Skittle

Date Added:

Comments: 0

Views: 865

Related Forum: PC Building Forum

Share:

In this tutorial I will show you the basic of declaration statements of variables.
Declaring variable in C# is quite similar to other languages so moving between them will not be too difficult. To declare a variable, you start off with modifiers, such as:
  • public
  • private
  • static etc
, or none if none are needed. You then follow it up with the Type or class such as:

  • string
  • int
  • bool
  • TextBox
  • Random
  • Form
After this, you will have the name of the variable followed by a semicolon to finish the line. Here's a few example variables:

public bool myBoolean;
private Button myButton;
public static string;

If you need help with anything, feel free to PM me

Ratings

Current rating: 2.00 by 1 user
Please take one second and rate this tutorial...

Not a Chance
1
2
3
4
5
6
7
8
9
10
Absolutely

Comments

"[C#] How to declare variables (Simple)" :: Login/Create an Account :: 0 comments

If you would like to post a comment please signin to your account or register for an account.