Welcome to visit
This journey contains a few streamlined introductions: the most common features of Scala are presented. It is designed to help beginners learn the language.
This is just a brief introduction, not a complete language tutorial. If you can, consider buying a book or reviewing other resources.
What is Scala?
Scala is a modern, multi-paradigm programming language designed to express common programming patterns in a concise, elegant, and type-safe manner. It seamlessly integrates the features of object-oriented and functional languages.
Scala is an object-oriented language
Scala is a purely object-oriented language, and in a sense all values are objects. The type and behavior of an object are described by classes and traits. Classes are extended to a complete substitution of multiple inheritance through subclasses and flexible mix-based mechanisms.
Scala is a functional language
Scala is also a functional language, in a sense all functions are values. Scala provides a lightweight syntax for defining anonymous functions, which supports higher-order functions, allows functions to be nested, and supports Curry. Scala's sample class and its built-in support for pattern-matching model algebra types are used in many functional programming languages. Singleton objects provide a convenient way to group functions that are not members of a class.
In addition, Scala's pattern-matching concept extends naturally to XML data processing by ignoring the right sequence pattern, through generic extensions through extractor objects. In this case, the for deduction helps to make the query. These features make Scala an ideal choice for applications such as Web services development.
Scala is a statically typed language
Scala is equipped with an expression system that can statically enforce the use of abstractions in a secure and consistent manner. Specifically, this type of system supports:
Generic class
Deformation annotations
Upper type boundary and bottom type boundary
Inner classes and abstract types as Object members
Composite type
Self-referencing of an explicit type
Implicit arguments and implicit conversions
Polymorphic method
Type inference means that the user does not need to comment the code with redundant type information. Finally, these features provide a powerful foundation for the safe reuse of programming abstractions and the type-safe expansion of software.
Scala is extensible
In practice, the development of specific domain applications often requires language extensions in specific areas. Scala offers a unique combination of language mechanisms that make it easy to add new language constructs in the form of libraries.
In many cases, this can be done without using a meta-programming tool such as macros. For example:
Scala is interoperable
Scala is designed to interoperate well with the popular Java Runtime Environment (JRE). In particular, the interaction with the mainstream object-oriented Java programming language is as smooth as possible. Newer Java features, such as SAM,LAMBDA, annotations, and generics, have direct similar functionality in Scala.
Scala features that do not have Java analogues, such as default parameters and named parameters, are compiled as close to Java as possible. Scala has the same compilation model as Java (individual compilation, dynamic class loading) and allows access to thousands of existing high-quality libraries.
TODO all completed will replace the relevant link in the text