Java Basics Review

Source: Internet
Author: User

First, this; class variable/class method

1.this: Used to differentiate between properties in a constructed method (only used internally)

2. Class variable: (access modifier) static data type variable name

Access method: Class name. Variable name (or object name). Class variable name)

3. Class method: (access modifier) static data type variable name

Access method: Class name. The class method name (or object name). class method Name)

Second, encapsulation: access modifiers:

Iii. Inheritance: Resolving code Reuse (Java is a single inheritance, differences and multiple inheritance of C + +)

1. Method: Class Subclass extends Parent class

2. Note: A subclass inherits at most one parent class; b Java all classes are subclasses of the object class;

Method overloading (overloading): In the same class, a function with the same name is allowed, but the number of arguments or the type of the parameter is different.

Method overrides (overriding): Subclasses override parent class methods.

Java Basics Review

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.