"DAY3" Java object-oriented and function

Source: Internet
Author: User

1. Object-oriented oriented

Object-oriented is relative to process-oriented

Object-oriented and process-oriented are a kind of thought

Process-oriented emphasis is on functional behavior

Object-oriented encapsulates functionality into objects, emphasizing the objects with functionality.

Object-oriented is a process-oriented

Object-oriented Features: 1. Encapsulation 2. Inheritance 3. Polymorphism

Class: Classes are abstractions of objects, software abstractions of things in the real world.

Object: An instance of the class.

Instance: An instance is an object.


2. Functions

A function is a separate applet defined in a class that has a specific function, also called a method.

The format of the function:

Modifier returns a value type function name (parameter type form parameter 1, parameter type parameter 2, ...)

{

Execute the statement;

return value;

}

Return value type: The data type of the result after the function is run.

Parameter type: is the data type of the formal parameter.

Formal parameter: is a variable that stores the actual arguments passed to the function when the function is called.

Actual parameter: The specific value passed to the formal parameter.

return: Used to end the function.

Return value: The result of the function operation, which is returned to the caller


Problems encountered:

For functions, the use of classes in program code is not yet very skilled.

"DAY3" Java object-oriented and function

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.