.net - Problems in declaring a variable as Byte in VB.NET -


i'm trying out program found on net. why necessary put curly braces @ end of statement? gives error: "byte has no constructors".

dim data byte() = new byte(1023) {} 

i can't put code either, produces error "byte cannot 1-dimensional array".

dim arr byte() = new byte() 

can explain me why happening?

you need curly braces, because if don't put them, means you're trying call constructor single object -- error different reasons:

  1. you can't assign single object array. (this true.)
  2. byte doesn't have constructor. (this true in particular case.)

Comments

Popular posts from this blog

jQuery clickable div with working mailto link inside -

WPF: binding viewmodel property of type DateTime to Calendar inside ItemsControl -

java - Getting corefrences with Standard corenlp package -