| Free tutorials for Java, Eclipse and Web programming |
Version 1.7
Copyright © 2009 Lars Vogel
22.11.2009
| Revision History | ||
|---|---|---|
| Revision 0.1 | 14.02.2009 | Lars Vogel |
| First version - Draft | ||
| Revision 0.2 | 14.06.2009 | Lars Vogel |
| Added Eclipse installation, first scala example | ||
| Revision 0.3 | 15.06.2009 | Lars Vogel |
| Variables in Scala | ||
| Revision 0.4 | 23.08.2009 | Lars Vogel |
| Bug report for first scala project | ||
| Revision 0.5 | 24.08.2009 | Lars Vogel |
| Added JDT Weaving | ||
| Revision 0.6 | 25.08.2009 | Lars Vogel |
| Hello Scala World working | ||
| Revision 0.7 | 21.09.2009 | Lars Vogel |
| Functions | ||
| Revision 0.8 | 22.09.2009 | Lars Vogel |
| Loops | ||
| Revision 0.9 | 09.10.2009 | Lars Vogel |
| Collections | ||
| Revision 1.0 | 10.10.2009 | Lars Vogel |
| Added clean tip | ||
| Revision 1.1 | 22.10.2009 | Lars Vogel |
| Added case clases | ||
| Revision 1.2 | 04.11.2009 | Lars Vogel |
| Added recursive functions | ||
| Revision 1.3 | 08.11.2009 | Lars Vogel |
| Class and constructors, objects | ||
| Revision 1.4 | 12.11.2009 | Lars Vogel |
| override | ||
| Revision 1.5 | 14.11.2009 | Lars Vogel |
| Method names, traits | ||
| Revision 1.6 | 21.11.2009 | Lars Vogel |
| uniform access principle | ||
| Revision 1.7 | 22.11.2009 | Lars Vogel |
| switch | ||
Table of Contents
Scala stands for scalable language which indicates that Scala is suitable for small scripting tasks as well as large enterprise applications. The creator of Scala is Martin Odersky.
Scala is a general purpose programming language designed to express common programming patterns in a concise, elegant, and type-safe way. Scale compiles to Java bytecode and therefore runs on the JVM.
Scala is a hybrid language, it is a object-orientated progrmaming languate as well a functional programming language.
Skala has objects and classes. Objects are singletons and are defined via the keyword "object". Classes are defined via the keyword "class".
Scala does not support primitive types, everything is Scala is an object, e.g. the number 1 is an object and has methods.
Methods can use special signs, e.g. +, -, ->, =>. For example the sign "+" is a method defined for the Object integer. As Scala allows you to avoid the dot and the braces if a method has only one parameter you still can write 1+2 but this really means 1.+(2) and is a method call to the method "+" to the instance 1 of object integer.
Scala tries to be very concise, for example semicolons at the end of a line are optional. Scala follows the uniform access principle , which describes that the access to method invocation and field selection should be the same (this principle was taken from the programming language Eiffel).