Methods of declaring classes in Java

Source: Internet
Author: User

Method header \ return type \ formal parameter.

Method Header: Method naming convention, hump convention (Camel casing), Cas:capital and Small.

Formal parameter: The method can be controlled by the value of the argument.

Return type: Method can return only one result, but can return multiple references in the form of a collection.

method, a function that is executed by a particular object.

In a Java class, the relative order of a feature (property and method) declaration is irrelevant.

Programming habits: Declare all attributes at the very front of a class declaration, that is, declaring a property before a class method declaration.

Returns the statement, return, is the statement that jumps out of the method, and can return void, i.e. no information is returned.

Programming Habits: A method only contains a return statement at the end, unless the method performs a series of operations, one step fails, the entire method fails.

method to define the business logic (business rules) internally.

More Wonderful content: http://www.bianceng.cnhttp://www.bianceng.cn/Programming/Java/

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.