Export (0) Print
Expand All
4 out of 5 rated this helpful - Rate this topic

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

ADD
Show:
© 2014 Microsoft. All rights reserved.