[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 479
  • Last Modified:

vb.net object instantiation and initializing properties

In C# I can create a object and if the class has exposed properties I can quickly instantiate them using the following technique. Does such a thing exist in VB.NET?

Car car = new Car()
{ Brand = "Ford", Model = "195" };
1 Solution
Gerry BartleySoftware EngineerCommented:
Dim car As New Car With {.Brand = "Ford", .Model = "195"}

Featured Post

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now