Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Section A.6. Anonymous types

A.6. Anonymous types

The anonymous types feature enables you to create objects without declaring a class beforehand. Because the newly created object doesn’t have a class, the var keyword is the only way to declare it, and the object initializers offer the syntax to create properties.

Here’s an example:


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint