Properties and object Private fields of the 007-scala class

Source: Internet
Author: User

007-scala properties and object Private fields of a class actual combat

The class used in the Scala class must be assigned the initial value of the DEF function if no arguments are given without the parentheses 2. No need to add public declaration getter and setter Combat getter Method: Def Agesetter method: Def Age_var Variable default build getter and setter method Val default only Generate Getter Method object Private property actual combat variable declared as private after this variable can only be used inside this class Private[this] object private Property This class's own method can only access the methods of its own objects or properties that cannot access other objects (including objects produced by this class) or method properties that are used in the configuration of the driver and the generation of methods that enable the isolation of instance members by using this method

Welcome to the vast number of enthusiasts to learn and exchange. Also welcome to join the study enthusiasts

DT Big Data Dream Factory Exchange Group: 462923555

DT Big Data public account: Dt_spark

Video Watch Links

http://www.tudou.com/plcover/Yy5F5gsurSE/

Properties and object Private fields of the 007-scala class

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.