Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

Video How to: Declare an Object by Using an Object Initializer

Visual Studio 2008

Object InitializerVideo How To

Authors: Kathleen McGrath, Harry Miller, Sahnny Johnson, Mick Alberts, Microsoft Corporation

Applies to: Microsoft Visual Basic 2008

Length: 00:03:37 | Size: 26.3 MB | Type: WMV file


Watch the video

Download the video and transcript

Read the step-by-step article

Object initializers enable you to declare and instantiate an instance of a class in a single statement. You can also initialize one or more members of the instance at the same time, without invoking a parameterized constructor.

This video shows you how to create an instance of a Student class by using an object initializer in three different ways. The following tasks are included in the process:

  • How to create an object of a named class by using an object initializer.

  • How to declare a new instance of the class and then assign a value to it.

  • How to declare a new instance using local type inference.

The Visual Basic Help includes the code and the steps that are demonstrated in this video. See How to: Declare an Object by Using an Object Initializer.

Community Additions

© 2015 Microsoft