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

2. Type Less, Do More > Reserved Words

Reserved Words

Table 2-4 lists the reserved words in Scala, which we sometimes call “keywords,” and briefly describes how they are used (see [ScalaSpec2009]).

Table 2-4. Reserved words
WordDescriptionSee …

abstract

Makes a declaration abstract. Unlike Java, the keyword is usually not required for abstract members.

Class and Object Basics

case

Start a case clause in a match expression.

Pattern Matching

catch

Start a clause for catching thrown exceptions.

Using try, catch, and finally Clauses

class

Start a class declaration.

Class and Object Basics

def

Start a method declaration.

Method Declarations

do

Start a do...while loop.

Other Looping Constructs

else

Start an else clause for an if clause.


  

You are currently reading a PREVIEW of this book.

                                                                                                                    

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

  

Start a Free 10-Day Trial


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