Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Scala for Java Developers
  • Table Of Contents Toc
  • Feedback & Rating feedback
Scala for Java Developers

Scala for Java Developers

By : Thomas Alexandre
4.3 (16)
close
close
Scala for Java Developers

Scala for Java Developers

4.3 (16)
By: Thomas Alexandre

Overview of this book

Table of Contents (19 chapters)
close
close
Scala for Java Developers
Credits
Foreword
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Final tips


The following sections enlist a few final tips and tricks that you might find handy while working with the REPL.

Copying and pasting in the REPL

As a reminder, this feature introduced in Chapter 8, Essential Properties of Modern Applications – Asynchrony and Concurrency, makes it easy to execute a full code snippet at once in the REPL. For instance, the following lines of command illustrate how the copy and paste feature in REPL helps the easy execution of code:

scala> :paste
// Entering paste mode (ctrl-D to finish)

[Copy a code block from somewhere with ctrl-C/ctrl-V]

  case class Person(name:String)

  val me = Person("Thomas")
  val you = Person("Current Reader")
  
  val we = List(you,me).map(_.name).reduceLeft(_+" & "+_)
  val status = s"$we have fun with Scala"
  
[Once you are done with pasting the code block, press ctrl-D]

// Exiting paste mode, now interpreting.

defined class Person
me: Person = Person(Thomas)
you: Person = Person(Current Reader)
we: String...

Unlock full access

Continue reading for free

A Packt free trial gives you instant online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech

Create a Note

Modal Close icon
You need to login to use this feature.
notes
bookmark search playlist font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Delete Note

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Edit Note

Modal Close icon
Write a note (max 255 characters)
Cancel
Update Note

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY