what's the difference between dim as and dim as new?

what's the difference between dim as and dim as new?

There is no difference with value types (Integer, Double, Structures, ...).
The instance is created anyway in both cases.

There is a difference with reference types: Without new, only the space for
the variable is reserved (currently 4 bytes = 32 bits). No object is
created. The variable contains Nothing (= no reference). With New, it is
equal to
dim o as type
o = new type
which means it also creates an object and stores the reference to the object

上一篇:easyui中对数据的判断来显示,formatter控制


下一篇:poj 2449 Remmarguts' Date 【SPFA+Astar】【古典】