"Spark Asia-Pacific Research series" Spark Combat Master Road-2nd Chapter hands-on Scala 3rd bar (2)

Source: Internet
Author: User

3, hands-on generics in Scala

generic generic classes and generic methods, that is, when we instantiate a class or invoke a method, you can specify its type, because Scala generics and Java generics are consistent and are not mentioned here.

4, hands on. Implicit conversions, implicit parameters, implicit classes in Scala

Implicit conversion is one of the key points that many people learn about Scala, which is the essence of Scala:

Let's take a look at the example of hidden parameters:

The above example uses implicit parameters, of course, you can display the specified parameters:

Here's an implicit class:

"Spark Asia-Pacific Research series" Spark Combat Master Road-2nd Chapter hands-on Scala 3rd bar (2)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.