Java_tij_ chapter Sixth-access control permissions

Source: Internet
Author: User

Thingking in Java translation version is too difficult to read

Simply speaking, the translator is completely in English, grammar and Logic translated, and the Chinese is a lot of difference AH sister!

Have free time, I also want to translate the original English book

Or maybe it's better to translate this tij than you.

In addition, the book is a lot of Java related words do not understand, and there is no detailed explanation, is it I picked up the reason for reading?

Like what:

What's JavaBeans? What are the components? Search for it ...

where JavaBeans

I think the better definition is "a software component structure that extends the capabilities of the Java language to construct reusable software components." "

Put a picture first, the source as above hyperlink

Then introduce the bean properties.

Properties are separated from each other, and they are named for attributes that affect the appearance or behavior of the JavaBean, usually the bean's data field. Private data fields are often used to hide the implementation details from the user and prevent accidental user damage. The Get/set method is used to ensure that the user can read and write this property.

How to name the property:

In general, theget method is named get<propertyname> (), with no arguments, and returns a base data type value or object that is consistent with the property type. For example:

Public String GetMessage () {}

public int getxcoordinate () {}

For a Boolean property, theget method is named is<propertyname> () and returns a Boolean value, for example:

public Boolean iscentered () {}

The set method should be named set<propertyname> (DataType p) with a parameter that is the same as the property type, and the return value is void, for example:

public void Setmessage (String s) {}

public void setxcoordinate (int x) {}

Attributes describe the state of a bean, which is used to store properties, but the bean attribute does not have to be a data field. For example:

public int getmessagelength () {

return Message.length ();

}

In simple terms, it is a series of getxxx,setxx,isxxx methods that are encountered when looking at someone else's code.

Later, the author seems to have an example of the event monitoring model ·

Currently only in the book to see the concept, and so I do not in the actual project operation will understand the deeper.

Java_tij_ chapter Sixth-access control permissions

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.