.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

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -