Behavior of Java objects

Source: Internet
Author: User

Behavior of Java objects
1. The behavior of the object includes the definition of the object and the invocation of the object (advanced post-Stack)

2. Formal parameter arguments
Formal parameters are defined in a method declaration by using the
An argument is used when a method call

3.Java is passed by value, so there is a difference between the base type and the reference data type.
The basic data type passes the value in, and the reference data type is passed in.

4. Method overloading
That is, the name of the method is the same and the parameters are different.
Different parameters include different number of parameters, different types, or different order.

5. Constructors
function is used to create objects
Can be overloaded and can have arbitrary permissions.
When the permission is private, it is a single state.

6.this and Super
Only the first row can exist in the constructor, so only one appears.
The specific difference:
. ()
This invokes the object's other constructors for the property or method of the current object
Super invokes the constructor of the parent class by calling the parent class's property or method

Behavior of Java objects

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.