Java_ class and Object 08_ form parameter and return value problem

Source: Internet
Author: User

1. Formal Parameters:

Class Name: An object that requires this class

Abstract class Name: A subclass object that requires this class

Interface Name: An implementation class object that requires this interface

Case one:

  

Case TWO:

  

Case THREE:

  

2. Return value type:

Class Name: Returns the object of the class

Abstract class Name: Returns the subclass object of the class

Interface Name: An object that returns an implementation class for the interface

Case one:

  

Case TWO:

  

Case THREE:

  

3. Chain-Type programming

Object. Method 1 (). Method 2 () .... Method N ();

This usage: In fact, after the invocation of Method 1 (), an object should be used;

After Method 2 () is called, an object should be returned.

After the method n () call is complete, the object may or might not be an object.

Case one:

  

Java_ class and Object 08_ form parameter and return value problem

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.