What is the equivalent of VB's "Dim" statement in C#? -


C # is picking, except for example, no useful reference can be found for this.

So, what is the C in DIM?

In VB, dim declares a particular type of variable ( Or variable type, if you do not specify one) If you call xx to xx, then it's a type of foo to x it is said.

In C #, the equivalent is to rule the type according to the name of the variable such as:

  Foo x; Int i;  

You can also assign it in one step:

  Foo x = new Foo (); Int i = 6;  

supports the C # type of estimation, you can also do this:

  // Based on this assignment, X and I Type type compiler. Var x = New Foo (); // now type fu var i = 10; // type of i type type  

a dim to declare a object as a type of VB in a similar type Similar is C #:

  object o = ...; // An object instance can hold any value or reference type.  

Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -