Peggy Fisher demonstrates her approach to a previous challenge where a Java program is translated into the Scala language. Learn how she approaches this problem here.
- Welcome back!…How did you make out with your first challenge?…Well I hope you had fun…and I hope you were able to be successful.…What I'd like to do is walk you through…my approach to the problem…so you can see my thought process along the way.…I'm going to do this both in a text editor…as well as the Scala IDE.…So here I have open the Calculator.Java file…and I'm going to start by saving it with a .scala extension.…Then I'll change the program to follow the Scala syntax.…Let's get started.…
I'm going to do File, Save As…and I'll do Calculator.Scala.…I already have one created so I'm going to override it.…So I'm going to say Replace It? Yes.…Now I need to change the program.…I'm going to start at the very top on line one…and instead of using Public Class,…I'm going to change this to an object.…I'm going to get rid of the comment…because I don't need that Java.comment anymore…and in order to define a method,…I have to use the keyword DEF.…
I don't need the visibility modifier public.…I can get rid of that.…Or Static or Void.…
- Installing Scala
- Integrating with IDEs
- Creating variables
- Using special functions
- Basic types and operations
- Tuples, sets, maps, arrays, and lists
- Classes, fields, and methods
- Singleton objects
Skill Level Intermediate
1. Why Scala?
2. Scala Basics
3. More Scala Basics
4. Objects with Scala
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.