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
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

Chapter 6. Objects > Enumerations

6.6. Enumerations

Unlike Java or C++, Scala does not have enumerated types. However, the standard library provides an Enumeration helper class that you can use to produce enumerations.

Define an object that extends the Enumeration class and initialize each value in your enumeration with a call to the Value method. For 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